I have some input fields with name="something" and value=""
I would like to replace value="" with value="something"
How can I do it with regex? Actually, can I do that with regex?
I have some input fields with name="something" and value=""
I would like to replace value="" with value="something"
How can I do it with regex? Actually, can I do that with regex?
Perhaps something in Javascript? I would grab the input name and put it into the value, quick and dirty example here: http://jsfiddle.net/c3tdLLyL/1/
var newValue = document.getElementsByName("inputname")[0].name
document.getElementsByName("inputname")[0].value = newValue