Edycja Kodeks:
Zobacz wynik »
Spróbuj sam - ©
w3ii.com
<
!DOCTYPE
html
>
<
html
>
<
body
>
<
p
>
The charAt() method returns the character at a given position in a string:
<
/p
>
<
p
id
="demo"
>
<
/p
>
<
script
>
var
str =
"HELLO WORLD"
;
document.getElementById(
"demo"
).innerHTML = str.charAt(
0
);
<
/script
>
<
/body
>
<
/html
>
<!DOCTYPE html> <html> <body> <p>The charAt() method returns the character at a given position in a string:</p> <p id="demo"></p> <script> var str = "HELLO WORLD"; document.getElementById("demo").innerHTML = str.charAt(0); </script> </body> </html>