<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<style>
</style>
</head>
<body>
</body>
<script type="text/javascript">
var str="Hello world!";
console.log(str.charAt(0)); //H
</script>
</html>
Javascript如何获取到字符串的第一位元素
原创祈澈菇凉 ©著作权
文章标签 bootstrap js javascript css jquery 文章分类 JavaScript 前端开发