I have a definition list and I need to delete all the <dt> tags who doesn't have any <dd>
In this particular case: Herramientas, Suplementos, Repuestos, Herramientas and Anti pinchaduras
The list can vary wildly because it's stock dependent (any category <dt> can get empty)
I tried this
$('dt+dt').each(function() {
$(this).remove();
...
I am using a select element to change the search type on a media site (i.e. search by genre, search by artist).
I have created the dropdown and can get the selected option via a variable but now I need to replace the name attribute on the input element with the variable/selected option. I have seen the below code to change the "value",...
There are many input elements which IDs are
question5,question6, question7
,..., how to select these input elements using Jquery?
I do not mean $('#question5'), I mean to select the group of them.
Also How to get the the last number like 5,6,7,... using Jquery?
...
HTML code: The HTML code is dynamically created.
<li>
<div class="above">What do I like best?</div>
<div class="below">
<label>Answer:(1 words)</label>
<input id="question6" type="text" size="5"/>
<label id="sign6"/>
</div>
</li>
<li>
<div class="above">What city do I like?</div>
<div class="bel...
In the example below, I'm trying to figure out how to hide the fieldset if the text within the tags = Groups
<fieldset class=" collapsible">
<legend class="collapse-processed"><a href="#">Groups</a></legend>
I tried this, but, it winds up hiding all the fieldsets, not just this one...
$(this).find('legend').each( function() {
if...
Read some other things on here re: this similar problem but am not sure how to apply this to my dilemma.
I have a jquery function that replaces some HTML in a list..
For example, before the function runs:
<ul id="mylist">
<li id="item1">blah blah blah</li>
<li id="item2">blah blah blah</li>
<li id="item3">blah blah blah</li>
</ul>
Th...
I'm trying to write a reusable function to retrieve all data in a table that is passed to it and store it in an array.
I'm not sure how to pass the reference to the table.
I could do something like...
passTableRef($('#tableId th'),$('#tableId td'));
but I would like to pass just the table reference in case I would like to elaborate ...
I'm trying to fire an event on spacebar press if an url is found in the last word typed and kill that event if there is a result so if the user keeps typing... the function doesn't keep on sending requests to the server. I'm tired and hope this makes sense... Basically I'm trying to accomplish what facebook has when you submit a post a...
Using the following sample markup:
<ul>
<li><div>Hello</div>World</li>
<li>Hello World
<ul>
<li style="voice-family: dizzy">What a wonderful world</li>
</ul>
</li>
<li><a href="hello.html">Hello World</a>
<ul>
<li>Goodbye world</li>
</ul>
</li>
</ul>
I'm try...
There must be something simple I am missing. I'm trying to get the index of the element but keep getting -1.
HTML:
<div id="rating_boxes">
<img src="/img/ratingbox.gif" class="ratingbox" alt="Rate this Speech" />
<img src="/img/ratingbox.gif" class="ratingbox" alt="Rate this Speech" />
<img src="/img/ratingbox.gif" class="ratingbox" a...
I have the following script at the end of my page:
<script type="text/javascript">
jQuery.noConflict();
jQuery(function() {
jQuery('#optElem').change(function(){
jQuery.post('http://example.com', { 'id1': 1, id2 : jQuery(this).val() },
function(data){
jQuery('#abc').html(da...
typically when you refer to an object you would use a selector like this :
$(this).jqueryfunction()
if u would need an element within this object you would use :
$('typicalselector',this).jqueryfunction()
My question is how would I use jquery selector to select various objects something along the lines of :
($(this.fistobject) and...
There are several divs on my page with classes my_widget-2, my_widget-8, etc.
What javascript or jQuery code can I use to get the number "2" (ie. the number that appends the first matching widget)?
Thanks in advance for your input.
Note: If I were to write this question again, I would change the order of these class names and ask for ...
I've got some HTML like the following:
<span id="A">Text I'm interested in
<span id="B">Other crap I don't care about</span>
</span>
I'm looking to get the text content of span "A" excluding any nested tags (i.e. the content of span "B" in the above example). I'm trying to get the text content, not the HTML content. Also, in my part...
I need to change the src attribute of the image when the link is being hover on
<div class="clear span-33 last" id="navigation">
<div class="hicon span-1"><a href="#" title="Homepage"><img src="../Assets/images/home.png" /></a></div>
</div>
Also change it to default when the link is not hovered on...
...
Hi all,
I'm trying to select an HTML element on my page that has a specific class and ID. Here's the tag:
<div class="statusLight" id="green"></div>
I tried this with no luck:
$statusLight = $('.statusLight#green');
I know that I could simply say
$statusLight = $('#green');
But I was trying to find a way to select it based on ...
Hi,
I have a h4 with an img in it like this. I bind a click function to the h4. This works well. But I'm not able to select the img in it. I want to select the img in order to replage the src attr with .attr("src").replace("up", "down"); .
<h4 class="collapsable_head">
<img id="up_down" class="icon" src="/crm/img/modifier_down.gif" alt...
Hi please look at the HTML below. I am trying to use jQuery to get every 3rd instance on the DIVs with class="box" contained within the DIV with class="entry" to have a no right hand margin:
My HTML code:
<div class="entry">
<div class="box">
SOME HTML....
</div><!-- end .box -->
<div class="box">
SOME HTM...
I have encountered code that leverages jQuery, similar to the following.
NAMESPACE = {
propertyA : $("#selector-a"),
propertyB : $("#selector-b")
}
$(NAMESPACE.propertyA).click(function(){
// ...
});
This seems to work, even though the syntax for attaching the click handler should be.
NAMESPACE.propertyA.click(function()...
Hi
I have a table that has some rows in it.
Here is an example of my table just with alot less table rows.
<table>
<tr>
<td>bob</td>
<td class="CheckThis">0 </td>
</tr>
<tr>
<td>Jim</td>
<td class="CheckThis">3</td>
</tr>
</table>
Now I want to look at the second table cells and get rows back that have value greater...