selector « html « jQuery Q&A

Home
jQuery Q&A
1.addClass
2.alert
3.array
4.attribute
5.browser
6.callback
7.clone
8.Cookie
9.Date
10.Development
11.document
12.dom
13.element
14.filter
15.Firefox
16.flash
17.format
18.html
19.input
20.internet explorer
21.json
22.mootools
23.page
24.performance
25.regex
26.safari
27.selector
28.setTimeout
29.String
30.table
31.Text
32.trigger
33.URL
34.video
35.xml
jQuery Q&A » html » selector 

1. Use Jquery Selectors on $.AJAX loaded HTML?    stackoverflow.com

I have

$.ajax({
  url: identity,
  success: function(data) { ProcessIdentityServer(data) }
});
When 'data' is returned, is there a way to run selectors against it without adding it into the DOM. So for ...

2. jQuery selector problem    stackoverflow.com

Here is my html source code:

<ul id="accordion">
 <li><h3><a id="1"></a></h3></li>
 <li><h3><a id="2"></a></h3></li>
 <li><h3><a id="3"></a></h3></li>
</ul>
and javascript
<script type="text/javascript">
 $(document).ready(function(){
  $('#accordion li h3').click(function(){
   //I want to alert the id attribute of a, ...

3. Jquery selector    stackoverflow.com

<a class='leftpanel_anchor' tag='solutions' href='javascript:void(0)' > Solutions to <span class='leftpanel_keywords'>firstConResult</span></a>
i have an anchor like this. i want to select the content inside span class 'leftpanel_keywords'. how can i do that with jquery??? ...

4. Select Nth previous sibling in jQuery?    stackoverflow.com

I'm trying to set up my jQuery selector but I'm not exactly sure how I need to write it. I've got a unordered list that looks something like this:

<ul>
    ...

5. Issue with selectors & .html() in jquery?    stackoverflow.com

The function associated with the selector stops working when I replace it's contents using .html(). Since I cannot post my original code I've created an example to show what I mean... ...

6. jQuery selector question    stackoverflow.com

I'm in a bit of a dilemma. I need to select div tags based on whether their children have a certain class. This is a code example of the DOM structure:

<div ...

7. Dynamically added HTML not being recognized by Jquery    stackoverflow.com

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 ...

8. HTML tag selector in jQuery    stackoverflow.com

This question is a bit open ended as I'm not sure it's possible or where to start with it. If you are familiar with the Web Developer Toolbar for Firefox you will ...

9. jQuery selectors?    stackoverflow.com

Using jQuery I am trying to create a function to show and hide the DIV below the table/tr that has been clicked, but when I click in one, all ...

10. jQuery: What does $("html") mean?    stackoverflow.com

What does $("html") mean? i.e. $("html").scrollTop(0);

11. Jquery if statements, selectors    stackoverflow.com

HI all, I am just starting to use jquery, I need to do something that I am not sure is possible. I know to use if statements on jquery is like normal javascript ...

12. JQuery can't call function on HTML placed using .load    stackoverflow.com

I have come into a bit of a problem. I am dynamically updating dropdown lists using JQuery and PHP. I am using the following JQuery code to run a PHP page ...

13. Perform jQuery selection on ajaxed html content    stackoverflow.com

Is it possible to load an html document using ajax and then perform a jquery selection on the loaded html? I want to perform a search against a remote search server ...

14. Get Raw HTML of Node in JQuery    stackoverflow.com

I have used $("#parent").html() to get the inner html of #parent, but how do I get the html of the parent itself? The use case is, I grab an input node like ...

15. HTML/Javascript: Selecting uncles/aunts    stackoverflow.com

So I have some code,

<div class="chunk" id="">
    <div class="chunkContent">
        <div class="textLeft" ></div>
        <div ...

16. JQuery Multiple selector problem    stackoverflow.com

<script>
    $(function(){
            $("a.a, a.b, a.c, a.d").click(function () {
          ...

17. Jquery .html replacer just empties my selector, what's wrong?    stackoverflow.com

$("#autoNames").html(function (index, html) {
                            ...

18. jQuery Selector    stackoverflow.com

so I'm having a bit of trouble getting a certain div to show onclick. Any takers? HTML

<div style="float:left;width:40px;">
<span class="productControl" style="position:relative;">
    <div class="productMenuHolder" style="display:none;">
    <ul class="productMenuList">
  ...

19. What's the correct jQuery selector for this? I want to get all tr with attr x, which are directly beneath (same level) given tr    stackoverflow.com

I'm currently working on something like a tree, and I want to be able to fold/unfold children. I guess the most easy way to get this is by using nested lists, ...

20. How could you with jQuery select the number at the end of the pathline?    stackoverflow.com

I am trying to grab that 15 at the end of the href with jquery..

 <a class="ajax" href="/organizations/1/media/galleries/15">Silly Gangs</a>
Any ideas?

21. Javascript Download to excel sheet    stackoverflow.com

There is an HTML table as

         <table>
               <tr><th>NAME</th></tr>
  ...

22. Why this jquery selector does not work?    stackoverflow.com

I have a task from a client to correct a page and I found that jQuery descendant selector does not behave as expected. Here is an excrept of the HTML:

<form action="http://submit.url/subscribe.php" method="post" ...

23. jquery selector - Select value not inside another nested tag    stackoverflow.com

Is it possible to select the value of a tag which is not inside another nested tag? For example in the following code I want to get ' Text I want to ...

24. error in jquery code for adding html control dynamically    stackoverflow.com

Here is my Html and jquery code for adding html control dynamically.Here my part of jquery code (that add No. of children control dynamically) works well.But the second part that add no. ...

25. Help with optimizing some functioning jQuery    stackoverflow.com

I have some simple jQuery that adds some tab functionality. This is based on something I found somewhere (can't recall where), but it's probably mostly original at this point. I was ...

26. jquery selector doesn't work when html is replaced!    stackoverflow.com

Please, help me with following problem:

<!-- this is the visible code -->
<div id="divid">{some default content}<img class="img" src="GoNextArrow.jpg" alt=""></div>

<!-- this is a hidden list of contents -->
<div style="display: none;">
    ...

27. Can you use jquery's :eq() selector twice in the same expression?    stackoverflow.com

I'm trying to write a table sorter function, so I need to be able to get the HTML of the nth column of the nth row of the table. I tried ...

28. jquery :[] selector?    stackoverflow.com

Given a SELECT element:

<select>
    <option>foo</option>
    <option>bar</option>
    <option>baz</option>
</select>
I want to select the OPTION element with the value "bar". This doesn't work:
$('option[text="bar"]').attr('selected', true);
However, this ...

29. jquery siblings() without selector not working    stackoverflow.com

Simple table:

    <table class="schedules">
        <th colspan="2">Saved Schedules</th>
        <tr>
       ...

30. Jquery selector issue    stackoverflow.com

I have the following html markup on my page,

<div id="sig_container">
    <div id="layer1" class="layer ui-draggable ui-resizable ui-resizable-autohide">
    <div id="layer2" class="layer ui-draggable ui-resizable ui-resizable-autohide">
    ...

31. Selecting the next tag using jQuery    stackoverflow.com

I have a select and 2 td tags as below.

<select name="accesslevel"><option value="A1">A1</option>
<option value="A2">A2</option></select>

<td id="Level3">

<td id="Level4">
I need to hide the td with Level3 id if A1 is selected in the select and ...

32. jQuery selector to select a select tag where value selected is something    stackoverflow.com

How do I select all the select boxes using a jQuery selector where value selected is "A1"? Sample select box:

<select name="accesslevel">
<option value="A1">A1 Access</option>
<option value="A2">A2 Access</option>
</select>
I have to use the selector to do ...

33. How can I rewrite this without using JQuery library just with JavaScript?    stackoverflow.com

I have a couple of lines of code in JQuery:

     var central = $('#townid option:contains("Central")');
     if (central.length){
       ...

34. jQuery :contains with html    stackoverflow.com

I have a table that contains comma separated lists of numbers like this: <td>72,76,81</td>. I'm trying to select the table cells that don't contain a particular number. This selector worked: $("td:not(:contains('76'))", $table) The ...

35. :not() in various guises isn't working    stackoverflow.com

I'm making a simple jQuery navigation system but I am far from expert at it, as the following code may demonsytrate.. HTML:

  <ul id="main-nav"> 
       ...

36. jQuery uncaught exception: syntax error, unrecognized expression [ tabindex="something"]    stackoverflow.com

All of a sudden some UI functionlities in our site are not working and I'm getting the error message: jQuery uncaught exception: syntax error, unrecognized expression [ tabindex="something"] THIS IS MY CODE:

var thumb_src ...

37. Trouble with Jquery change method    stackoverflow.com

I am using jquery's change() method in my code.

 $("select,input,textarea").change(function ()
    {
        needToConfirm = true;
    ...

38. jQuery nested selectors on dynamically added components    stackoverflow.com

I have this html page where I try to calculate the salvage price of a car, I have an inputfield with its list price, and a button where I can add ...

39. Jquery selector syntax question    stackoverflow.com

I encounter the following syntax:

 $('#sourcePane input:checked~img');
I know it is selecting all input elements that are checked and also under the element of id= sourcePane ? right? But what is ~img? what ...

40. jQuery: Selecting custom html tags (with specific values)    stackoverflow.com

I have an html page which has elements such as the following:

<input data-required-by="books magazines stationery">
What I'd like to do is select all elements in jQuery that have "books" in the 'data-required-by' ...

41. Simple JQuery Selector    stackoverflow.com

Given the following HTML structure:

<div id="wrapper">
    <div id="top">
        <a href="http://example.com" class="link">click here</a>
    </div>
    <div id="middle">
 ...

42. is this Valid HTML for jquery     stackoverflow.com

I have the following HTML.

div#main-content div#right-col div#post-show div#post-img div#post-img-large{

}
div#main-content div#right-col div#post-show div#post-img div#post-img-large 
   img#post-img-large{
}
As you can see, I am using same id for div and img. Is this ...

43. How can I select the "shallowest" matching descendant?    stackoverflow.com

How can I select the first "shallowest" input? My current selection will be the div marked "selected".
I won't know how many levels down it will be.

<div class="selected"> <!-- already have this -->
 ...

44. Populate Multiple Select Controls with the Same Values using jQuery    stackoverflow.com

I have two select controls that I want to populate with the exact same options. I started with the following code (which does not work):

var result = // raw <option></option> html from ...

45. Jquery selectors optimization    stackoverflow.com

Consider the html

<div id="one" >
<input type="radio" value="x" name="group" >
<input type="radio" value="y" name="group" >
<input type="radio" value="z" name="group" >
</div>
I have two questions regarding the DOM access with Jquery.
  1. Question One
I just want to ...

46. jquery selector question    stackoverflow.com

I ran into this code today:

$("#features").tabs("#someid > .someclass", {
    effect: 'fade',
    fadeInSpeed: 500,
    fadeOutSpeed: 500,
    rotate: true
});
I can't figure ...

47. Flowplayer Overlay - Change target selector    stackoverflow.com

After reading some topics and replies in the Flowplayer Forum, I figured out that you guys might be a better help for my problem. As you may know the Flowplayer ...

48. selector ^ in jQuery - how to all?    stackoverflow.com

<input id="aaa1" value="vvv">
<input id="aaa2" value="">
<input id="aaa3" value="ooo">
<input id="aaa4" value="">
<input id="aaa5" value="ooo">
<input id="aaa6" value="ooo">

if($('input[id^="aaa"]').val().length == 0){
    $('input[id^="aaa"]').css('background-color', 'red');
}

$("#aaa1").live("click", function(){
  $(this).after("<input id='aaax' value='ooo'>");
});
why this working only for first input? ...

49. Get selection from defined html code    stackoverflow.com

is it possible to get selection from defined string? For example:

str = "<li>Some text...</li>";
Now I want to get that text between "li" tags, using str variable as input. I tried something ...

50. Jquery insertAfter() correct syntax for the selectors    stackoverflow.com

I have a div

<div id="imgDIV"><h4>My Debug DIV</h4></div>
and I want insert a debug message at the top of the div but after the first h4, this way I get my ...

52. jQuery selectors and the HTML5 selector API    forum.jquery.com

HTML5 brings two new methods to the js selector API: querySelector() and querySelectorAll(). These methods can be used to match elements against a group of selectors. I think, a lot of the functionality overlaps with jQuery selectors. My guess is that these new methods will be a few times faster than jQuery selectors because they are natively implemented.

53. using a selector that was loaded by .html    forum.jquery.com

54. How to get selector from .html(output)    forum.jquery.com

55. [jQuery] HTML :contains selector equivalent    forum.jquery.com

[jQuery] HTML :contains selector equivalent in Using jQuery 2 years ago Hey,One component to my current project involves retrieving various blocksof text and html from a database that are displayed on a website (awebsite that is composed of the same blocks of text and html from thesame database) via $.getJSON, and thereafter locating each of theretrieved ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.