jquery selectors, when separated by commas, need to be aware of the scope issues

Source: Internet
Author: User

jquery selectors, when separated by commas, need to be aware of the scope issues:

<%@ Page Language="Java"Import="java.util.*"pageencoding="UTF-8"%><%    StringPath=Request.getcontextpath (); StringBasePath=Request.getscheme ()+ "://" +Request.getservername ()+ ":" +Request.getserverport ()+Path+ "/";%><!DOCTYPE HTML><HTML><Head><Basehref= "<%=basePath%>"><MetaCharSet= "UTF-8"><title>B Index</title><Linkrel= ' stylesheet 'type= "Text/css"href= ' B/css/bootstrap.css '></Head><Bodystyle= "margin:150px;">    <Div>        <inputtype= "checkbox"Info= "1"ID= "Chktestid"><label for= "Chktestid">Selection box</label>        <inputtype= "checkbox"Info= "2"ID= "Chktest2id"><label for= "Chktestid">Select box 2</label>        <ButtonID= "Btnclickid">Click Me</Button>        <inputtype= "hidden"value= "Hiddenvalue">    </Div>    <Div>        <TableID= "Tblformid">            <TR>                <TD><inputtype= "text"ID= "Txtin01id"></TD>            </TR>            <inputtype= "text"ID= "Txtin02id" >        </Table>        <ButtonID= "Btnundertblid">Click Me</Button>    </Div>    <Scripttype= "Text/javascript"src= "Js/jquery-1.11.1.js"></Script>    <Scripttype= "Text/javascript"src= "B/js/bootstrap.js"></Script>    <Scripttype= "Text/javascript"src= "Js/index020.js"></Script>    </Body></HTML>

$ (' #tblFormId Input,input[type=hidden] ') Select the result:

<input type= "hidden" value= "Hiddenvalue" ><input type= "text" id= "Txtin01id" >

The comma in the selector is a collection of two conditions, and the part preceding the space in the first condition cannot be taken to the next selector.

So the original meaning is: $ (' #tblFormId input, #tblFormId Input[type=hidden] ')

jquery selectors, when separated by commas, need to be aware of the scope issues

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.