How to use regular expressions to obtain the value in input type = "text"

Source: Internet
Author: User

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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.