有一组具有不同值的单选按钮。
有时值有引号,如No i don't
.
所以当我试图获取它的值时,它返回为No i don
.
我需要知道如何查找字符串中是否有引号并将其替换为转义字符,以便当我尝试获取该值时,它应该将引号返回给我。
HTML 代码
<input type="radio" value="Yes" name="pollchoice">
<input type="radio" value="No" name="pollchoice">
<input type="radio" value="No, i don't" name="pollchoice">
In the above code, when third choice is selected and tried to get the value of the selected radio button it returns as No, i don
instead ofNo, i don't
提前致谢