[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Select statment in Jquery

Posted on 2011-10-21
4
Medium Priority
?
209 Views
Last Modified: 2012-08-14
Guys,

In Jquery if i use this command the Jquery will use AND on select statement.

$("input[type='text'][class='t']").css("background-color", "blue");

Is it possible to use OR  ?

$([ ][ ])  - AND
$( ) - How to make OR

Many Thanks
0
Comment
Question by:Mortarello
  • 2
4 Comments
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 37006065
you can use like this..

$("input[class='t']").css("background-color", "blue");

0
 
LVL 17

Accepted Solution

by:
sonawanekiran earned 1000 total points
ID: 37006089
You can use comma(,) for this. Below statement means change background color to blue for all input having either type text or input with class t

$("input[type='text'], input[class='t']").css("background-color", "blue");
0
 
LVL 20

Assisted Solution

by:chaitu chaitu
chaitu chaitu earned 1000 total points
ID: 37006090
0
 

Author Comment

by:Mortarello
ID: 37006120
Tks Guys..
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question