I have an string that I get from a td of my html table, it’s an input with no Id and in others td exists the same input with different values and purposes. My string is the following when has a value (I read the value from database)
<input value="10:00" />
And when there’s not a value the string is the following:
<input value="" />
What I want to do is to replace the value part of that string. At the moment I have the following code:
myString = myString.replace('value="', 'value="' + newValue );
The problem is that I get the following string
value="10:0013:0014:00"
My code is adding my new values instead of replacing, what I’m doing wrong or how can I solve it.