JavaScript: განსხვავება გადახედვებს შორის

[შემოწმებული ვერსია][შემოწმებული ვერსია]
შიგთავსი ამოიშალა შიგთავსი დაემატა
ხაზი 13:
კოდის მაგალითი:
 
<syntaxhighlight lang="html5">
<div style="border:1px dashed #2fab6f;padding:1em;margin:1em 0;">
<!DOCTYPE html>
<source lang="xml">
<html>
 
<head>
<script>
<title>Example</title>
Document.write("My First JavaScript");
</scripthead>
<body>
 
<button id="hellobutton">Hello</button>
</source>
<script>
</div>
document.getElementById('hellobutton').onclick = function() {
alert('Hello world!'); // Show a dialog
var myTextNode = document.createTextNode('Some new words.');
document.body.appendChild(myTextNode); // Append "Some new words" to the page
};
</script>
</body>
</divhtml>
</syntaxhighlight>
 
[[ვებგვერდი|ვებგვერდზე]] ეს კოდი გამოჩნდება როგორც <<Hello World!>>
მოძიებულია „https://ka.wikipedia.org/wiki/JavaScript“-დან