Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
BRH 48
#DOTNET 34
#ASP.NET 29
jQuery 22
ASP.NET 20
.NET 20
WPF 9
jquery interview questions 9
jquery faq 8
ASP.NET4 8

Archive · View All
February 2011 10
September 2011 4
August 2011 4
July 2011 4
May 2011 4
April 2011 4
March 2011 4
October 2011 4
June 2011 4
January 2011 4

How can you select various HTML Elements using jQuery?

May 21 2011 12:02PM by Hima   

jQuery can be used to select HTML elements using element selector. Below are some of the examples of how to use selectors.

  • $(<’element>’)  - Selects all elements with the given tag name.
  • $(‘p’) – Selects all  Paragraph  Elements
  • $(‘a’) – Selects all Anchor tags in side a web page
  • $(‘I’)  - Selects all Italic tags in the webpage
  • $(‘input[type=text]’) – Selects all textboxes in side a webpage

After selection we can call methods .

Selecting multiple elements

$(‘p,a,div,span’) – Selects all p, a, div, span elements in the web page.

<script>$("p").after( $("b") );</script>

The above script selects all p and makes the content after <p> tag as bold. 

Selecting all the elements

$(‘*’) – This will select all html elements in web form 

Example
<html>
<head><script src="http://code.jquery.com/jquery-latest.js"></script> </head>
<body>
<input type='text' />
<textarea > </textarea>
</body>
<script>
$('input[type=text], textarea').css({width: '70%'});
</script>
</html>

Tags: BRH, jQuery, element selectors, select all elements,


Hima
31 · 6% · 1776
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

2  Comments  

  • your folowing example

    The above script selects all p and makes the content after

    tag as bold.

    is incorrect. This does not do this. In fact this does not do anything. Try here: http://jsfiddle.net/m8QS9/

    commented on Jul 15 2011 9:34AM
    akhil.rex
    2746 · 0% · 4
  • It seems author have just copy pasted code from Jquery documentation and has not put an effort to understand what the code does.

    To understand what it

    does check out this

    Of course, it doesn't make p tag bold.

    commented on Feb 29 2012 3:18AM
    Nilesh
    1249 · 0% · 20

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]