Ok, pretty much the most important thing in Javascript is editing text on a web page. This can be done really easily.
say the HTML of a page was something like this
so pretty much what you would do if you want to change the text "nothing so far" to something else... what you would do is..
so pretty much what happens is the code loops through all the elements "td" on the page until it finds one with the className "info" and then changes the text.
another technique that is helpful is:
document.getElementById("")
an example of this is
a HTML page is this
so to change the text of the element with the id "yes" we would do this...
hope this helped
say the HTML of a page was something like this
Code:
<table>
<tr>
<td class='notinfo'>nothing so far</td>
<td class='info'>nothing so far</td>
</tr>
</table>
so pretty much what you would do if you want to change the text "nothing so far" to something else... what you would do is..
Code:
<script type='text/javascript'>
var a = document.getElementsByTagName("td")
for(x=0;x<a.length;x++){
if(a[x].className == "info"){
a[x].innerHTML = "Alot to be done"
}}
</script>
so pretty much what happens is the code loops through all the elements "td" on the page until it finds one with the className "info" and then changes the text.
another technique that is helpful is:
document.getElementById("")
an example of this is
a HTML page is this
Code:
<table>
<tr>
<td class='notinfo' id='yes'>nothing so far</td>
<td class='info' id = 'not'>nothing so far</td>
</tr>
</table>
so to change the text of the element with the id "yes" we would do this...
Code:
<script type='text/javascript'>
var a = document.getElementById("yes")
a.innerHTML = "Alot to be done"
</script>
hope this helped


