I have the following code:
<div id="container">
<input type="text" name="a1" id="a1">
<input type="text" name="a2" id="a2">
</div>
And I want to replace all instance of the text "a" to "b" for the id and name property for all the element inside the div id="container"
so the new code should be like this:
<div id="container">
<input type="text" name="b1" id="b1">
<input type="text" name="b2" id="b2">
</div>
I just can't seem to be able to make it work using the javascript replace().
awithbbecause you'd end up with markup like<input type="text" nbme="b1" id="b1">. So what are you actually trying to do?