I'm using jQuery :contains selector to filter through some link tags. The following code works great.
$('a:contains("string")').each(function(i){
//do some stuff
});
I'd like only run this function if the anchor tags are inside a specific class, I've tried the following but it does not appear to work:
$('.my_class a:contains("string...
I'm trying to use jQuery to load the body of another HTML document, which contains our AdSense banner. It should display under each blog entry when in list view. I'm able to get it to load text, even images, but not the banner; the banner is a small script.
Here is the website we are working with: http://neverknowtech.com/data/ (that's ...
<IMG height="160" alt="Web Content Image" src="../image/journal/article?img_id=16505&t=1273484793531" width="240" pngSet />
I have the this code for the image , and I want to select the image based on the attribute "pngSet"
I am trying this , but not working.
$("img[pngSet='']").css('border' ,'1px solid red');
...
I think this example would make it clear. My HTML is this:
<li class='nav-active'><span class='maillink' id='spnInbox' >Inbox</span></li>
<li><span class='maillink' id='spnSentMail'>Sent Mail</span></li>
<li><span class='maillink' id='spnDraft'>Draft</span></li>
<li><span class='maillink' id='spanTrash'>Trash</span></li>
When the ...
Hi,
I have created a script which is surprisingly working. (I do not do much JavaScript)
What I have is a load of images listed within a div. These images are hidden. JQuery gets the properties of the images and puts them into an array. When the body is clicked, the background image of the page changes. This works nicely.
However, I n...
Hello,
I would like to hover an image and popup a div, without plugins. just basic jquery
the jQuery is like this:
<script type="text/javascript">
$(document).ready(function() {
$(".wrapperfortooltip div img").hover(
function() {
$(this).css('border', 'solid 1px #E90E65');
$("div", this).stop().fadeI...
Hi, I have the following code in jQuery for a set of radio buttons which all have the same behaviour on click (they show some hidden fields). I was previously duplicating the same code for each individual selector, so i just used multiple selectors as in the code below. However, this doesn't really work, as when a couple of the radio but...
Basically, is there a way to write
a.children('.outer').children('.inner')
without the intermediate selector? I can't write
$('.outer > .inner', a)
because I don't want to do full-depth search against a — I know that the .outer elements are immediate children of a.
It's partly a matter of "elegance", but partly because I'm tryin...
I'm a little confused about which jQuery method and/or selectors to use when trying to select an element, and then remove certain descendant elements from the wrapped set.
For example, given the following HTML:
<div id="article">
<div id="inset">
<ul>
<li>This is bullet point #1.</li>
<li>This is bullet point #2.</li>...
Hi all,
I am trying to make some dynamic effect to a HTML page using JQuery.
1.
When the user clicks a Radio field, the field will be highlighted.
2.
When the user clicks the Radio 'Man', a Input text box will be provided immeditely just below it.
Here is my simple HTML page, but I don't know how to do with the JQuery part:
<Table>
<T...
Dear Experts,
I wanted to achieve an effect to switch the position of the 2 HTML Divisions when they are clicked.
So when clicked, the top will shift to the bottom and bottom will shift to the top.
Here is what I can come up with
<html>
<head>
<script type="text/javascript">
$(document).ready(
function(){
$('div').clic...
I tried
$(":input:not(input[type=button],input[type=submit],button):visible:first")
but it doesn't find anything.
What is my mistake?
UPD: I execute this on $(document).load()
<script type="text/javascript">
$(window).load(function () {
var aspForm = $("form#aspnetForm");
var firstInput = $(":input:not(input[type=button],input...
How do I select sibling node of the current node?
Here is the snippet:
<div id="main">
<a class="test" href="test.html">Hello</a>
<div>Some text</div>
</div>
//script
$(".test").click(function() { $("this:parent > div").toggle(); });
or
$(".test").click(function() { $("this ~ div").toggle(); });
None of these works. I know I ...
if i have this html
<div class="whole">This is a <div class="min">Test</div></div>
i want to change the html of the "whole" div when i click on the "min" div:
i have tried this below, but it doesn't seem to work.
$(document).ready(function() {
$('div.min').live('click', function() {
$(this).prev('.whole').html("<img B...
if i have this code in jquery:
var parentDiv = $(this).parent('.copyInstance');
inside this div there is a form.
how do i reference a form element inside this selector? i want something like this
$.post($(parentDiv + " Form").attr('action'), $(parentDiv + " Form").serialize(), function(data) {
});
but this above doesn't see...
Could someone tell me the difference between those two. The first one is working on FF and not in IE (6) and second one is working in IE (6) and not in FF (I am using the Jquery 1.4.2). We had to detect the browser and write the script accordingly.
...
For some strange reason, whenever I have a selector and expect to get multiple items, jQuery is only returning the first item, instead of the entire collection.
This is the HTML I have:
<a id="reply-424880" class="reply" href="#" rel="nofollow">Reply</a>
<a id="reply-424885" class="reply" href="#" rel="nofollow">Reply</a>
And the sel...
I'm pretty new to jQuery... so far I'm impressed. But I encountered a situation today that is giving me trouble. I want to use .html() to get some raw text and use that in a selector, but that function only returns the first element.
In the following structure, how can I get ALL of the "toggle_containerLG" divs to show when I click on...
I have a bunch of elements like this:
<div></div>
<span></span>
<table></table>
<div></div>
<span></span>
<div></div>
I need to check whether or not there's a table element in between the divs, and if so do something.
$('div').each(function () {
if ($(this).nextUntil('div').include('table')) {
$(this).addClass('got-a-table');
...
If I have a selector like
$.('.active');
How can I see how many items that matched?
Alternatively, is there an easy way to see if more than zero elements were matched?
...