i need a javascript function to be called on certain button click, upon that click the button name will change.
ie,
<input type=button id = button1 value=boy onclick=function(boy,girl)>
i need the javascript function to take 2 parameters and check if the value of the button is the first paramter, then the value will become the 2nd and vice versa.
so if i press the button and it says BOY, it will become Girl
and if i press the button and it says Girl it will become boy!
using javascript please thx.
There are many ways to do this, but by
getByIdfunction showed below you will have a portable function to access to DOM elements byid: