String

Kim jeong ho·2020년 6월 26일
0

문자열은 큰 따옴표 나 작은 따옴표 안에있는 텍스트 일 ​​수 있습니다.

var carName1 = "Volvo XC60";
var carName2 = 'Volvo XC60';
링크텍스트

<!DOCTYPE html>
<html>
<body>

<p>Click the button to display the first character of the string "HELLO WORLD".</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
	var str = "HELLO WORLD";
    var res = str.charAt(0)
    document.getElementById("demo").innerHTML = res;
    }
</script>

</body>
</html>

profile
김정호

0개의 댓글