In Javscript 's we need to use perdifined methods and key words as well. When I am doing a tutorial 4 (3SFE407 ) there was a ..... :p
sname=document.forms[0].lastname.value;
In this case :
sname is called as a 1 st form's [indexing (like an array index)] Last Name .that textfield's
name is lastname.
that "document.forms[0].lastname.value" get in a value to sname.
firstletter=sname.charAt(0);
In this case :
This is a predefined method what we get in to surname's {This a person's surname} first charachter is pointed and that value
assign to firstletter{it should be a letter}
<div id="title">
User Registration
div>
In this case:
We are changing the title according to the surname.here we need to get a id to the title.its like a variable.
document.getElementById("title").innerHTML=title;
In this case:
Here what we got as the titles name is refered. then it changes the title name according to your lastname