1. How to obtain the value in input type = "text" through regular expressions?
2. How to filter out the input type = "checkbox" tag?
In this way, only values in the input type = "text" can be obtained in regular expressions, but the input type = "checkbox" tag cannot be filtered out!
<textarea id="runcode11808"><Textarea name = "cnbruce" Cols = "60" rows = "6"> <input type = "checkbox" name = "checkbox" value = "1"> <input type = "text" name = "text" value = "2"> <input name = "text" type = "text" value = "3"> <button onclick = "alert (PLA (cnbruce. value) "> alert </button> </P> <p></textarea>
[Ctrl + A select all Note: If you need to introduce external JS, You need to refresh it to execute]
<textarea name = "cnbruce" Cols = "60" rows = "6"> <input type = "checkbox" name = "checkbox ""value =" 1 "> <input type =" text "name =" text "value =" 2 "> <input name =" text "type =" text "value =" 3 "> <button onclick =" alert (PLA (cnbruce. value) "> alert </button> </P> <p>
[Ctrl + A select all Note: To introduce external JS, refresh it before execution]
Solution: <Textarea name = "cnbruce"> <input type = "checkbox" name = "checkbox" value = "1"> <input name = "checkbox" type = "checkbox" value = "1"> <input type = "text" name = "text" value = "2"> <input name = "text" type = "text" value = "3"> <button onclick = "alert (PLA (cnbruce. value) "> alert </button> </P> <p>
[Ctrl + A select all Note: If you need to introduce external JS, You need to refresh it to execute]