JQuery :: Selecting A Class And A Variable Defined ID At The Same Time?
Apr 27, 2011
I'm trying to select a class (.home) and an ID (#something) at the same time,
normally I'd use:
but in this instance, the ID is already stored in a variable called "newpage" - I'm trying the following:
(note, selecting the id on it's own with just$(newpage) does work, so I know the issue isn't with my variable, it's just a matter getting both the class and the variable stored ID selected at the same time)
So I'm new to jquery and I'm trying to spice up a navigation menu in my cms. I'm having trouble selecting children in a nested UL. Its just an add class on hover. But as you can see, it's selecting all of the children on hover. [URL]. I'm trying to find a solution that allows each listed link to be highlighted on hover, regardless of its place.
I have list of forms generated from SQL database and every single one of them has to have unique id, so how I can select the specific item that is to be manipulated (changing values via php).the $("#submit").click(function())will trigger every submit buttons on the page, so how I can tell it to be "#<randomInteger>" thought of passing the unique value with onClick="myfunction(unique_id)", but don't know how it goes with jQuery.
I have mulitiple 'a' tags with different classes (aclass1, aclass2, aclass(n)) and I have multiple divs, also with consecutive classes (divclass1, divclass2, divclass(n)). Is there a way to select the 'a' tags to match the div based on its number (ie. 'aclass1' with 'divclass1' and aclass2 with divclass2)? For example something like this:
I've been writing a slideshow script that I've had working perfectly on my mac in Chrome and Safari, however I went to look at it in IE8 and lo and behold it falls over. It says 'object doesn't support this property or method' in relation to the new SlideShow line in the main() function.
just a very basic question. Have a div (id - photos) with multiple images. 1) Does this select them all? $('#photos img') 2)If so, how can i capture this information? Like so -> var bunchOfStuff = ($('#photos img')); and 3) if so, why can't i do something like alert(bunchOfStuff.length)into code tags...
I'm having some issues with firefox, chrome seems to work ok. Firebug is giving me an error stating country is not defined. The line it's saying it's on is where the function for an ajax call to populate a select input on page load.[code]...
Using a while loop in a function, I am trying to test an input character against a stored string of characters. I want the function to return the input character only if it is not in the stored string of characters. The code I've prepared is as follows:
The code works fine if I remove it from the function wrapper but if the function is called I keep getting an error message that the variable validLetter is not defined. :confused: Can anyone see why this is the case?