jquery ("#field") is null
Hello, I have a selectbox with month periods in it. Here is my code: $(function(){ $("#ppsub_ppterm_id").change(function(){ var term = this.options[this.selectedIndex].text; if(term == "Eenmalig"){ ...
Hello, I have a selectbox with month periods in it. Here is my code: $(function(){ $("#ppsub_ppterm_id").change(function(){ var term = this.options[this.selectedIndex].text; if(term == "Eenmalig"){ ...
Trying to select anchor tags that are a descendants of a div with a particular id, say it is #mydiv1, #mydiv2 and #mydiv3. myFunction = function() { var theDivs = $("#mydiv1, #mydiv2, #mydiv3"); theDivs.hover(function(e){ $(this+" a:link").css("color","#99ccff"); },function(e){ $(this+" a:link").css("color"...
My design of a page forces me to refresh the whole page with html that I have loaded via ajax. $('html').replaceWith(data); Gives me errors. Any ideas? ...
Can't understand why this code changes color of DIV element to blue, but doesn't change color of a SPAN element. Any ideas? <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("#prev ~ div").css("color", "blue"); $("#prev ~ span").css("color"...
Hi there, I've been battling to get this right...basically I have the following HTML setup: <div class="box10"> <span class="label01">Name:</span> <input class="tboxes" type="textbox" /> </div> "span.label01" is an inline element, and appears to the left of the textbox "input.tboxes". What I am trying to do attach some style t...
With at-rules, it's possible to have a ruleset for elements during that at-rule event (like printing, mobile devices, etc.) But what about just for a specific selector? I am working on a sub page of a larger site, and I have to use the master stylesheet for any of my pages. Sometimes a style rule just gets trumped by a rule from the ma...
I've read the documentation over and over and I can't get why this doesn't work: From inside a function, calling the following: alert($(this).parent().parent().html()); returns something looking like this: <div class="something1"> <div class="whereThisStarted">stuff</div> </div> <div class="something2">stuff</div> <div class...
Suppose if I have multiple tables in my HTML page (without their 'id' attribute), so how can I select first row of the first table or any specific table using jQuery selectors? ...
Here's my goal: do something on an element, an <optgrooup>, if all of its children are invisible. My code below outlines the in red if it has any invisible children. But I want to do so only if all the children are invisible. If the element has any children that are visible, then don't highlight it. How can I tweak the jQuery select...
I'm using this on a page: jQuery('.class1 a').click( function() { if ($(".class2").is(":hidden")) { $(".class2").slideDown("slow"); } else { $(".class2").slideUp(); } }); With a structure in the page later that goes like this: <div class="class1"> <a href="...">text</a> <div class="class2">text</div> </div> This is wo...
What is the difference between these two CSS statements: h1 em { color:#ddd; } and h1 > em { color:#ddd; } As far as I can tell they do exactly the same thing (though according to what I've read at W3C in the first case em is considered a 'descendant' where as in the second it is considered a 'child', though I have no idea how tha...
I hope I can find a solution to this one. Here it goes: After I have submitted my form to add a message to the database, I create a <div> with the load method. After that I do some stuff in the callback function. When the function to create the new <div> has finished, it returns to the calling function that is supposed to prepend the m...
I have the following HTML code : <html> <head> </head> <body> <div id="never-selected"> </div> </body> </html> With JQuery 1.3.2, I would like to create wrapper around $() that allow you to select any element with any combination but the div #never-selected nor its content. I am trying to do it this way : _contex...
Hello, I'm learning JQuery and have found the factory function $() with its selectors quite useful. However, I cannot figure out how to select within a particular element I have named as a variable. For example: var thisDiv = $("#myDiv"); // thisDiv looks like this: <div id="myDiv"> <input id="apples" /> <input id="bananas" /> </div> ...
I'm setting up a very straightforward FAQ page with jQuery. Like so: <h2>What happens when you click on this question?</h2> <p>This answer will appear!</p> This is all inside a very specific div, so I'll be selecting the header with $('#faq h2'). Simple, right? Click on the H2, and use this.next() to make the next paragraph show up...
edited my original question The problem is the same for setting the id off a newly added element or if I use the argument noteid from the function. The result is that every element get's the same id if this function get's looped. How can I set a different id for every newly added element??? As it is now, the value in the submit event...
I want to invoke a selector of a method that has the usual NSError** argument: -(int) getItemsSince:(NSDate *)when dataSelector:(SEL)getDataSelector error:(NSError**)outError { NSArray *data = nil; if([service respondsToSelector:getDataSelector]) { data = [service performSelector:getDataSelector withObject:when withObje...
Hi i'm trying to use jQuery/javascript to make my life easier. I'm trying to use it to auto fill in the various html elements with the name of the place and country which comes from the file name of the image. Below is a sample of some of the html i have to work with: <div class="boxgrid"> <a href="gallery/angkor - cambodia.jpg" title="...
How do you make a separator in a select tag? New Window New Tab ----------- Save Page ------------ Exit ...
hei guys i want to select two divs with the same id in jquery. how do i do it? i tried this and it did not work jQuery('#xx').each(function(ind,obj){ //do stuff; }); i have jquery countdown timers in a page, and i update them via ajax. some of these countdown timers repeat and that is why i need to use the same id on the divs. ...