Simple Machine Codes
April 19, 2024, 06:30:05 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Jquery and SMF For Free #2(Contains)

Pages: [1]   Go Down
  Print  
Author Topic: Jquery and SMF For Free #2(Contains)  (Read 873 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« on: August 26, 2007, 02:51:27 pm »

The Contains Function
The Contains function is one of the main functions for Jquery.

Say you had something as easy as this:
Code:
<div>
<table><tr><td>Hello World</td></tr></table>
<table><tr><td>RAWR</td></tr></table>
</div>
Say you wanted to add something after the table that has the text of "Hello World" in it.  You would do this:
Code:
<script>
$("div table tr td:contains(Hello World)")
</script>

You do not have to have the "div table tr" part in it:
Code:
<script>
$("td").contains("Hello World")
</script>

This function does work with the 1.2.1 version of Jquery.
Code:
<script>
$("td:contains(Hello World)")
</script>

That just makes sure that your getting the exact tr with that certain text.
« Last Edit: February 26, 2008, 07:50:35 pm by Agent Moose » Report Spam   Logged

Share on Facebook Share on Twitter

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #1 on: August 28, 2007, 07:38:04 am »

I learnt that 'contains' is actually JQuery.
Report Spam   Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy