Javascript provide DOM ( Document Object Model ) developed by the World Wide Web Consortium. its describes how all elements in an HTML page, like input fields, images, paragraphs etc .
This specification provides a platform and language-neutral interface that allows programs and scripts to dynamically access and change the content, structure and style of a document 蓉sually HTML or XML傭y providing a structured set of objects that correspond to the document痴 elements.
DOM Types :
Javascript provide's several type of DOM Object.
There are a number of JavaScript methods specified by the DOM which allow you to access its structure.
<html>
<head>
<script >
function prasun()
{
var all language =document.getElementsByName("language");
alert("Total language:"+all language.length);
}
</script>
<form>
Hindi:<input type="radio" name="language" value="Hindi">
English:<input type="radio" name=
"language" value="English">
Sanskrit:<input type="radio" name=
"language" value="Sanskrit">
<input type="button" onclick=
"prasun()" value="language">
</form>
</html>
</head>
Output :
<html>
<head>
<script >
function notEmpty(){
var myTextField = document.getElementById('myText');
if(myTextField.value != "")
alert("You entered: " + myTextField.value)
else
alert("prasant say enter some text ")
}
</script>
<input type='text' id='myText' />
<input type='button' onclick='notEmpty()' value='CLICK' />
</html>
</head>
Output :
Others
Languages
Frameworks
Web / Design
Mobile Technology
Sql & Technology
R4R