select « dom « 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 » dom » select 

1. How to select within a container with jQuery?    stackoverflow.com

<div id="container1">
<span>...</span>
</div>
<div id="container2">
<span>...</span>
</div>
Say if I have get the jQuery object $('container1'),how to find the <span> in it?

2. How do I write selected jQuery DOM elements back out as XHTML snippets?    stackoverflow.com

I'm wanting to select some DOM elements using jQuery, modify some attributes, and then write the DOM elements back out as xhtml snippets for post processing. I want the resulting ...

3. how to detect which level on the dom is selected    stackoverflow.com

I have the following selector $('#navigation ul li a').click(function(evt) {} this get the elements i need, but also retries child elements. ie i get me this as well

#navigation ul li li a  ...

4. Select first sibling    stackoverflow.com

I'm trying to select the inner value of the first sibling - using jQuery - in an environment where I cannot alter the html markup. I have the following:

<tr>
    ...

5. jquery select elements between two elements that are not siblings    stackoverflow.com

eg. [I've removed attributes, but it's a bit of auto-generated html]

<img class="p"/>
    <div> hello world
      <p>
        ...

6. Selecting a link with jQuery    stackoverflow.com

I want to be able to search for a substring inside the href's in the below code and select the link AFTER the selected string. So, for example the string "page=2" ...

7. Jquery: Selecting specific characters/copy..*real* content not DOM elements    stackoverflow.com

I'd like to be able to run a search for the copyright, reg and tm symbols that were pasted in along with copy from something like Word and replace them with ...

8. How can you tell the difference between a generated and a selected element?    stackoverflow.com

Is it possible, in either the jQuery API or the DOM, to check if an element exists on the page or not? Consider these two variables:

var selected = $('span#mySpan');
var created = $('<span ...

9. How can I select elements living in a certain range of the DOM hierarchy?    stackoverflow.com

I have a DOM element C which is a descendant of DOM element A. There are several layers between them, one of which is an class of element named B. If ...

10. jquery select any dom element on page    stackoverflow.com

Does anyone know how to select any element (possibly on click) on page like body is selected, div is selected, div#foo etc... so i can place it to some variable and ...

11. Determine whether a jQuery selection is in the DOM    stackoverflow.com

I have a jQuery selection that either originated as a newly created element (e.g. $("<div/>")) and has no parent, or is actually an element in the DOM. What's the most efficient way ...

12. jquery - which DOM selection method is better to use    stackoverflow.com

Which is better to use and why?

if ($(target).parents('div#test').length) {
or
var target = $(evt.target); 
if (target.parents('div#test').length){

13. Ajax selecting a portion of the DOM    stackoverflow.com

I'm trying to load just a portion of the resulting html file into a particular div. This one supposedly should work. Can't get anything to work. Any help appreciated.


 ...

14. How to see/display/debug the selected dom nodes with jquery?    stackoverflow.com

Is there any good way to see/debug the result of a jQuery selector ? Let's say we have something like this

var arr = $('div > span').parent();
How can I see what the selector ...

15. Dynamically instantiating SELECT options via other SELECT selections    stackoverflow.com

Imagine, for a moment

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
As well as another identical select box
<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
 ...

16. javascript: select all elements with "data-xxx" attr WITHOUT jQuery    stackoverflow.com

Without using jQuery, what is the most efficient way to select all dom elements that have a certain data- attribute (let's say data-foo). The elements may be different tag elements.

<p ...

17. Is there a simple way to know the starting value of a select?    stackoverflow.com

I'd like to do this simply without saving the starting value of the select in an object. if i have (when i load the dom):

<select>
  <option value='1' selected>one</option>
  <option value='2' ...

18. Select element based on condition using Javascript DOM    stackoverflow.com

I have a jQuery statement as;

$("a[target="+iframeId+"]").attr("href", url);
What is the best way to write this in normal Javascript DOM such that the perofrmance is not affected much?

19. Need help selecting element from the DOM    forum.jquery.com

20. turning a dom element into a select whatsit    forum.jquery.com

21. Selecting by a custom DOM property    forum.jquery.com

22. $(..) select on a certain DOM Element    forum.jquery.com

Hi, I have a javascript tool in which I can supply a listener function, which has the parameter 'div', which is a dom element. Now I would like to apply $('a.enlargement').fancyzoom({Speed:0,showoverlay:true}); to that div, but I only have the reference. I know about the 'find' function, but that can only be run on a selection object. So how can I do ...

23. Problems with correct selecting in DOM    forum.jquery.com

Problems with correct selecting in DOM in Using jQuery 1 year ago Hi, I am one of the newbies and just started with jQuery (in Drupal CMS).I have menu which I want to foldout when hovering over the parent element. The code is generated by Drupal CMS, so my idea was to use jQuery to hang ...

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.