dom-traversal Questions

12

Solved

Do getElementsByClassName (and similar functions like getElementsByTagName and querySelectorAll) work the same as getElementById or do they return an array of elements? The reason I ask is because...
Piling asked 21/5, 2012 at 23:17

11

Solved

I can add many rows for a table, but I can't remove many rows. I only can remove 1 row per sequential add. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></scrip...
Scharaga asked 24/4, 2013 at 4:12

3

Solved

I am wondering if there is a way to select a specific element way up the DOM only using vanilla JS while not having to use parentNode multiple times. I understand you can do this with jQuery and mo...
Jumbo asked 25/8, 2018 at 23:14

6

Solved

Using jQuery how do I select a single child element? I've looked at the Traversing API and know I can select all the immediate children img elements like this: $(this).children('img'); And to se...
Curvet asked 24/9, 2009 at 20:52

4

Solved

I'm having trouble using prev() in jQuery where it's not selecting the right element. My HTML structure is as follows: <section id="about"> ... </section> <hr> <section id="...
Radiochemical asked 27/3, 2011 at 22:28

3

In Chrome DevTools, while debugging JavaScript in the Sources tab(adding the "debugger;" line in JS code and then stepping through the code using F10/F11), how can I view the DOM while stepping thr...

6

Solved

Is anybody working on a jQuery.closest() equivalent in the DOM api? Looks like the Selectors Level 2 draft adds matches() equivalent to jQuery.is(), so native closest should be much easier to writ...
Antipater asked 10/3, 2013 at 23:49

5

Solved

The following code: var borderTds = document.getElementsByClassName('leftborder'); gives me an error message in Internet Explorer 6, 7 and 8: Object does not support this method How can I ...

5

Solved

I'm trying to replace all text in between tags and I want to know the fastest way of doing so. An example would be trying to replace all text with the arbitrary string helloWorld, so that this: ...
Lubbock asked 4/2, 2017 at 13:6

2

Solved

I am trying to learn jQuery, I have following mark up In a div, I have two texts date and description and two buttons edit and delete. When I click the edit button, I want to get the date and descr...
Sofiasofie asked 12/1, 2017 at 19:20

1

Solved

In a Traversal pyramid app, how does one handle a resource w/ a __name__ that matches a view's name? If I wanted to get to the view callable "view" for a Resource, I'd use a URL path like:/foo/bar...
Lanthanide asked 13/5, 2016 at 20:7

7

Solved

Assuming the following script tag in a random HTML document: <script id="target" type="store"> //random JavaScript code function foo(){ alert("foo"); } foo(); </script> can anyb...
Plenitude asked 7/6, 2013 at 12:22

3

Solved

How can I iterate through all forms in a document using javascript?
Concerted asked 27/1, 2010 at 11:17

3

Solved

What I need to do is find all a elements on the page that contain "tag" in the href property and the text of the element contains certain word. For example <a href="/my/tag/item2">cars<...
Rabblerousing asked 6/3, 2013 at 23:34

1

Solved

I am both adding and removing table rows with jQuery. I can add rows easily, but am having trouble removing ones that were created. You can view the page in action here: http://freshbaby.com/v20/w...
Chromaticness asked 27/2, 2013 at 3:26

4

Solved

How can I change this: <div class="container"> <div class="span-19"> <div id="content"> <!-- variable amount of content --> <form class="move-me"> <!-- form -...
Clayclaybank asked 3/11, 2012 at 23:19

3

Solved

Please take a look at the snippet below: <div> <div></div> <div><!-- my target node --> <div><!-- not my target node --> <img /><!-- my sourc...
Hyperpyrexia asked 12/10, 2012 at 17:37

2

Solved

I am trying to find a <td> where the value is 5. It is a calender so there will only be one 5 value.
Cowskin asked 5/10, 2012 at 13:2

5

Solved

<ul id="attached_deals_tab" class="nav nav-tabs"> <li class="active"> <a data-toggle="tab" href="#Test1">Test1</a> </li> <li class=""> <a data-toggle="ta...
Melodee asked 26/9, 2012 at 14:40

4

Solved

I have a series of rows with columns and I want to select the value of an input field that is in a previous column to the input field (price input) that I am calling a function on when a key is rel...
Chamberlin asked 1/8, 2012 at 9:39

1

Solved

Let's say I have a hierarchy of elements, with #root at its root. I can use $('#root > * > *') to get all its grandchildren. Is there any way I could do that if I already have $('#root')? $(...
Otherdirected asked 30/5, 2012 at 19:48

2

Solved

Here is what I am trying to do Fox<span>Rox</span> before that FoxRox How do I wrap spans around Rox?
Cosette asked 4/5, 2012 at 4:0

1

There are a lot of questions about whether or not finding an element is faster via class or id or some other selector. I'm not interested in that. I want to know if you have: var link = $(this); /...
Buxton asked 3/5, 2012 at 4:8

2

Solved

Edit (2012-04-12): Since this question was asked it is now possible (as of jQuery 1.8) to make custom builds of jQuery. For most JavaScript projects that I work on, I want a simple, light-weight...
Armlet asked 6/4, 2012 at 15:29

3

Solved

What's the difference between these? Is one more efficient than the other? I'm a little bit confused to why they both exist. Say I have this markup: <table> <tr> <td>...</td...
Ecclesiology asked 23/1, 2012 at 17:33

© 2022 - 2024 — McMap. All rights reserved.