jquery-selectors

array comparison

I am trying to create a unique taskID list based on the selections. Each task may have 2 companies at the most. My problem is the taskID comparison below fails. My code: <script> $().ready(function() { $.validator.addMethod( "findRegex", function(value, element) { return /^.+::[1-9]\d{0,11}$/.test(value)...

How to assign a Text to a asp Label with jquery

i have a asp label in my page .i like to set some text in it with jquery . <asp:label id="lblError" runat="server" CssClass="error" /> Which method will i use. $(".error").text('hello'); or $(".error").html('hello'); or $(".error").val('hello'); i am confused with all this ?plz help . ...

jQuery clone() doesn't copy <select> DOM properties?

Consider the following HTML : <a id="add" herf="#">add</a> <div class="list"> <select> <option>1</option> <option>2</option> </select> </div> And Javascript : $('#add').click(function() { var copy = $('.list').last().clone(); copy.appendTo('body'); }); (OR : http://jsfiddle.net/5A5pN/) If you choos...

get current index jquery

hi i'm using a script made by http://snook.ca/archives/javascript/simplest-jquery-slideshow so basically the code i have now is $(function(){ $('.fadein img:gt(0)').hide(); setInterval(function(){ $('.fadein :first-child').fadeOut() .next('img').fadeIn() .end().appendTo('.fadein'); }, 6000); }); I wonder if it's poss...

How do I use jQuery selectors with an object?

I have an unordered list in an object: var myUL = $('ul#theID'); //I send this var to another function in the code I want the direct children only of this object (I have another 'ul' within each 'li' that also has 'li's in it), but this selector does not work: $(myUL + '>li').each( etc, etc... It gives me the error "uncaught except...

jquery remove check box on condition

In a div there are these check boxes(name="val1") and after a certain operation these check boxes are removed <div name="navigation_b"> <label id="selectall"> select all <input type="checkbox" name="selectall" /> </label> <input type="checkbox" name="val1" /> <input type="checkbox" name="val1" /> ...

jQuery: hidden visibility selector does not work in Firefox 3.6

<html> <script src="../jquery.js" type="text/javascript"></script> <body> </body> <script type="text/javascript"> $(":hidden").show(); </script> </html> Firefox 3.6 would show $(":hidden").show();, but IE 8.0 works fine. Is this a bug? PS: I'm using jquery 1.4.2. Thanks. ...

show() checkbox with jqueryj

If a checkbox is hidden using jquery .hide how to show it again if we know the value in the following case <input type="checkbox" value="1" name="m_q"/> <input type="checkbox" value="2" name="m_q"/> <input type="checkbox" value="3" name="m_q"/> <input type="checkbox" value="4" name="m_q"/> So the check box with value 1...

JQuery selecting children with same names

Hi guys, I have a list that is being fed in to my page using an ASP.NET repeaters. The repeater contains a div (divContainer) with two divs (divTitle and divDetails) inside it. I'm hiding the divDetails and only want to show it if the user click on divTitle. This works fine for me when in the first divContainer but all subsequent ones...

jquery confirm and exit functionality

In the html page shown,where is window.onbeforeunload = confirmExit code to be placesd so that when validate div is shown the alert message does not appear when the user clicks on cancel or save button.And if the user clicks or any other link the alert message should be shown If any other link is clicked makeajaxcall() function should b...

window.onbeforeunload functionality

When the user click on the OK button before redirecting how to call the delete function and then continue redirecting $(document).ready({ window.onbeforeunload = confirmExit ; }); function confirmExit() { var ele = document.getElementById ("localchanges") ; if (ele.value == "1") return "Changes are not saved. Discard change...

Is there any easy way to get DOM descendants like with the parents() method when using jQuery?

$('something').parents('selectors') lets me move several levels up the DOM at once, versus parent() which unsurprisingly returns the current element's immediate parent. Unfortunately (though logically), children() does not operate like parents() and instead only returns the element's immediate children, similar to how parent() works. I'm...

Multiple jQuery panel slides

Hi, I'm new to jQuery and have been following the tutorial here for a Panel Slide. http://www.webdesignerwall.com/tutorials/jquery-tutorials-for-designers/all-comments/#comments So far so good. Though I require a number of panel slides. The page is going to look very similar to this woothemes.com/themes/ When you click an image a 100...

selecting ul elements by number of li children

hallo all. i am trieng to build a function that gets all ul's on screen that have less then 3 li elements. i need this as a jquery object. so i dont mind if it will be a function or just one selector. how do i do it? thanks ...

jquery: howto return caller-id when using wildcard selectors

i'm using jquery to invoke JSON-requests and they're triggered form a bunch of autocomplete-fields. I use wildcard-selector and now need to find out which ac-field that fired the event. ... $( "[id*='_lookupCmb']" ).autocomplete({ source: function( request, response ) { $.ajax({ ... ... select: function( event, u...

jquery selector for child element.

What is the correct method for looping through the lowest level "li" elements? <div id="mainnav"> <ul> <li> <ul> <!-- These are the elements I want to loop through --> <li> </li> <li> </li> <li> </li> ...

jquery find command

Using .find() how to find whether radio button exists in a div or else raise an alert <div id="emp_form"> </div> ...

jQuery child selector?

I have a collection of div's which I need to remember and loop through, easy. var myCollection = $('div.myClass'); $.each(myCollection, function(myDiv){...}); Now I want to select some span tags in each of those div's but only those that are direct children of the div. This kinda works... $.each(myCollection, function(myDiv){ $('...

Need jquery selector

I have the following snippet of code on a page that I need to specifically target the number inside the b tag and put that number in a variable. I do not have direct access to this code or I would put and ID there. There are more than one td and b tags on the page but only one font size"3". What would be the correct selector to target th...

Selecting all descending nodes with JQuery

I want a click on a span tag with .myClass ,and all its descendants, to do something.. $('.myClass'). *<all elements below .myClass>*.click(function(){ //do something }); How do i select all elements below the .myClass selector ? Not only children, but every node below them aswell. Im in IE7 ...