jquery-selectors

jquery selecting all last elements of an nested tree menu unordered list...not just the :last-child...

I'm having some trouble figuring this out. I have an unordered list menu that I want to style all the last elements with a folder icon and style all the expandable (parent) elements with a plus.gif image. I wanted to simply change the class by using .addclass() using jquery, which will contain the css to add the background-image. My j...

jquery ajax html response change 1.3.2 vs 1.4.2 (aka where is my script tag?)

I've been using jquery 1.3.2 to pull snippets of html (including script) from a server. A typical response might be: <div id="content"><div id="inner">... <script type=...> alert("hello world");</script> <p>Hello World</p> </div></div> I've been using the query .get function: $.get($(this).attr("href"), function(response) { $(...

dynamically add elements from jquery or javascript

if a user types in an input say 3 into a text box three small text boxes should be shown below or in a popup through javascript or jquery .How can this be done... <input type="text" name="order">3</input> Thanks.. ...

Select subsets of elements, and wrap them in a div

Hello, I have a set of selected elements in jQuery: <div class="element"></div> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div c...

Validating groups of checkboxes using jquery

If I have groups of checkboxes like so: <input type="checkbox" name"checkboxes1" value="#value1"> <input type="checkbox" name"checkboxes1" value="value2"> <input type="checkbox" name"checkboxes1" value="#value3"> <input type="checkbox" name"checkboxes2" value="value1"> <input type="checkbox" name"checkboxes2" value="#value2"> <input ty...

JQuery traverse DOM and extract node value

I have the following DOM: <div class="qtip qtip-light qtip-active"> <div class="qtip-wrapper"> <div class="qtip-borderTop"></div> <div class="qtip-contentWrapper"> <div class="qtip-title"> <div class="qtip-button"></div> **Text I need to extract** </div> <div class="qtip-...

jQuery: how to create a new div, assign some attributes, and create an id from some other elements attributes?

jQuery: how to create a new div, assign some attributes, and create an id from some other elements attributes? How can I accomplish this. What I've tried below is not working and I'm unsure how to make it work. What I'm trying to do is create a div and assign it some attributes, then append this div to all the < li > elements that are ...

How to get jQuery to find the first list-item, rather than all list-items?

I'm trying to implement a basic jQuery infinite carousel. As much for the learning process as for anything else (as a rule I'm not a fan of re-inventing wheels, but...I have to learn somehow, might as well start with the basics). I've managed to get the list to animate left happily enough, but I'm stuck when it comes to selecting the fi...

Copying values of one table to another (how to convert this js function to jQuery)

Hi All, I am stuck with a small problem here.. What i am trying to do is copy description of id's from one table to another. I have writter half of the javascript and can anybody tell me how to convert this function in jquery. I want the description copied from the first table based on the id to the second table. Have done this in jquer...

Is there a better way to write this in jQuery?

$(".sectionHeader").click(function() { var row = $(this).parent(); while (row.next().length != 0) { row = row.next(); if (row.children().first().is('th')) return; row.toggle(); } }); ...

Jquery click event

This is my code $(document).ready(function () { $("#Button1").click(showDialog); }); var showDialog = function () { /* Something I do here */ } Here the "Button1" click event fire at first time, after that the event was not firing. Thanks, Ram ...

How can I get the href of a <link> tag using jQuery?

Hi, I've seen lots on how to do this with an tag, and I have no problem doing it with that one, but I can't seem to retrieve the href attribute of a <link> tag. Even trying to grab the link tag at all: alert($("link").length); Gives 0. Any ideas? Thanks, Matt ...

Identifying dynamically generated elements

In the following code, <script> function val() { //get alltextarea to validate } $(document).ready(function() { var html= '<form>' html += '<textarea name="test" id="test"'; html += '<textarea name="test1" id="test1"'; html += 'form'; $('#get_div').append(); }); </script> <div id= "get_div"></div> <input type="button" ...

jQuery selector issue finding image with usemap attribute

I have an image map in my page: <div id="books"> <img src="images/books.png" width="330" height="298" border="0" \ usemap="#map_books" /> <map name="map_books" id="map_books" alt="books"> <area shape="poly" coords="17,73,81,288,210,248,254,264, ..." \ href="/about" alt="books" /> </map> </div> I have a function that...

Simple jQuery Toggle of children

Um, why no worky? Trying to toggle a ul with this: $("#others").children(".btn").click(function(){ if ($(this).children("ul").is(":hidden")) { $(this).children("ul").slideDown(); } else { $(this).children("ul").slideUp(); } }); And: <div id="other"> <div id="galleries"> <a href="#" class="btn">Galleries >> ...

Get values of textareas generated dynamically

In the below code,the textaraes are generated dynamically ,now how to get these values for validations in valid() function.. <script> function valid() { //get all textarea vales for validation } function add(col_det) { var row = '<tr>'; row += '<td>'; row += '<textarea rows = "8" cols = "8" class = "input" W...

using jquery selector to change attribute in variable returned from ajax request

I'm trying to pull in a filename.txt (contains html) using ajax and change the src path in the data variable before I load it into the target div. If I first load it into the div the browser first requests the broken image and I don't want this so I would like to do my processing before I load anything onto the page. I can pull the src ...

jQuery + Jeditable - detect when select is changed

I'm using Jeditable for in-place editing. One the controls I am working with has the select type. When a user clicks on the field, the following select control is generated: <div id="status" class="editable_select"> <form> <select name="value"> <option value="Active">Active</option> <option value="Ina...

jquery problem with toggle event only fireing on the 2nd click...

Can anyone explain why the following jquery only fires the 2nd toggle event and how to fix it? Specifically, every time I click the nested < a > element it brings up the alert "2nd click". I tested the selector to make sure it was selecting the element properly and it does, or at least it inserted a class without any problems. The sel...

$().mouseMove <-- Empty selector in jQuery 1.4

The following bit of code breaks in the upgrade to jquery 1.4: $().mousemove( function (e) { defaults.mouseX = e.pageX; defaults.mouseY = e.pageY; }); }; What appeared to be a reasonable fix was adding "html" as the selector, ex: $("html"). The fix works fine - except now when the user mouses off the page, it doesn't ...