Skip to main content

Questions tagged [jquery-selectors]

Selectors can be used in jQuery to match a set of elements in a document. Most CSS selectors are implemented, as well as a set of custom ones.

jquery-selectors
-1 votes
2 answers
38 views

How can I select HTML elements which are rendered after DOM

I want to select OKBTN let main = document.querySelector("#main"); let okBtn = document.querySelector("#ok"); function myAlert(title,msg,icon){ let card = ""; ...
Pawan Lal Rathore's user avatar
0 votes
1 answer
28 views

How do I make a toggle Panel not be open by default? the toggle is made on JavaScript within the HTML

So I've got a page in which the user can find a "?" toggle to read information on how to use the page. However, whenever the page loads (or reloads/refreshes) the toggle panel opens up (as ...
Ren's user avatar
  • 1
0 votes
1 answer
28 views

Finding closest input in same cell multiple spans

I am having a hard time getting the closest input to the button clicked. Everything is on the same table cell. The button is inside a span and the input is inside 3 level span? Please see for ...
joanb's user avatar
  • 317
0 votes
1 answer
23 views

Error when using jQuery selectors pulled from a JSON configuration

I have a JSON object with jQuery selectors and values inside it. Special characters inside the selectors have (I think) been properly escaped. Here is what the JSON looks like: var config = [{ &...
JosephStyons's user avatar
  • 58.1k
0 votes
1 answer
35 views

Making a variable element from existing element / querySelector doesn't accept Variables

Im trying to select a child div from an array with the variable x This is only a sketch to illustrate what I'm trying to do: var x= 0; trackN = document.querySelector( .track :nth-child(x)) But ...
Dr_ Buhu's user avatar
0 votes
0 answers
85 views

app.js:55 Uncaught TypeError: Cannot read properties of undefined (reading 'value')

i have checked the node list before adding the 'fetchValues' function to make sure that it have a value , but when i add the function , this error shows up: Uncaught TypeError: Cannot read properties ...
Abdi Med Amin's user avatar
0 votes
1 answer
60 views

Why does MutationObserver not detect nodes after a random point?

I am building a Tampermonkey user script. My actual script is a lot more complex but I am able to reproduce with the following example. My script needs to work on Hacker News website. For example on ...
sudoExclamationExclamation's user avatar
0 votes
0 answers
19 views

tinymce setContent and setMode Operation

I'm Having a Problem with tinymce, Editor textarea is located under a div object, tinymce.get("#DV_Gorev_Genel_Liste #TXA_GorevTanimlamaPencereAlani_Genel_Aciklama").setContent(''); tinymce....
Halil İbrahim AYHAN's user avatar
0 votes
1 answer
33 views

In Javascript, how can I querySelector to get the innerHTML excluding one of the inner sibling divs

I have the following html: <body> <span class="comment"> EXAMPLES: <p><i>Example 1</i> - <a href="https://example.com/1">...
sudoExclamationExclamation's user avatar
0 votes
0 answers
81 views

How can I press Tab key and Enter key on browser using browser's console?

I want to press 2 buttons on the website one by one (by console code) but the click code doesn't work on one of them. So instead, I am trying to make console code that presses Tab key and Enter key ...
Robert's user avatar
  • 1
0 votes
0 answers
33 views

"OR" in var selector

I've trying to customise a script that normally triggers a GTM tag to populate a form's hidden field with a variable (session_url_campaign). Here is the script: <script> (function () { var value ...
Xavier Wallach's user avatar
0 votes
0 answers
34 views

I would like to change the execution order of my event listeners but they are interdependent [duplicate]

I am new to javascript and html coding. I am writing an html form with a javascript code in it which allows the user to add a list of venues and write information about them. When a venue is added by ...
Clara's user avatar
  • 13
1 vote
2 answers
48 views

Contains to return multiple values

I am using $('label:contains('something'); to get the label that contains 'something' in it it works perfectly fine but I want to be able to handle more than one label how to do it example: HTML: <...
Amado's user avatar
  • 383
0 votes
0 answers
51 views

What should be used instead of document.queryselectorAll() in React?

I have a working piece of code (a customised version of MUI DatePicker component). I'm using document.querySelectorAll in 2 places in my code. I'm asked to remove the usage of query selectors from the ...
Anser Waseem's user avatar
1 vote
1 answer
36 views

How can I select a DOM element, which name is changing [duplicate]

I have this DOM elelement, where the part of the name of the menu [ v15rco8kc2 ] is changing for every call of the document. How Could I use a joker in the QuerySelector? document.querySelector("#...
Walter Schrabmair's user avatar
0 votes
0 answers
38 views

Can't get value from child element using JQuery [duplicate]

I am trying to get the value of the third <p> element by referring to the id of its parent (id="pickup-searchbox"), but first I'm referring to the class of the first chid (class="...
Nikolay Kholin's user avatar
-1 votes
2 answers
115 views

Iterate Form with queryselectorall to put input value into array

I Have an html page and function is JS I noticed that myForms is a NodeList with two elements, form is 0 or 1, How do I retrieve the input values for each form? I also tried with var query = '' + ...
DevMD's user avatar
  • 29
0 votes
0 answers
59 views

How to use Javascript to expand Google PAA section?

I want to get the questions and answers from People Also Ask section of google using javascript (but inside a vb.net cefsharp browser using executequery). The section needs to be clicked to be ...
xhammer's user avatar
  • 145
0 votes
1 answer
139 views

JavaScript Click does not work on Google translate image

I try to code JavaScript extension for translate an image which is in the windows clipboard. Site page web: https://translate.google.fr/?hl=fr&sl=auto&tl=fr&op=images An image is already ...
OliveLion's user avatar
0 votes
1 answer
138 views

3cx change bubble button style in Wordpress functions.php - move up an async button and styling it after waiting fetch for async dom created

I have been struggling with the moving up of the chat bubble overriding my theme bottom login/out web app bar for 2 days: Tryed to: modify in Wordpress the child style.css and the functions.php The ...
Avsof web apps's user avatar
0 votes
1 answer
28 views

Find nodeList nested <span>

I'm trying to web-scrape for the first time in order to get the best deal out of my holiday. (My intention is to have a Telegram Bot that everyday checks a specific day in the hotel calendar and sends ...
Scheggia's user avatar
0 votes
0 answers
180 views

ApplyTransaction Remove from AG Grid React does not remove the row from the DOM right away. document.querySelector still returning something

Hi I am trying to disable a button based on if a css class name is present in the DOM or not, using document.querySelector(); If document.querySelector('invalid-cell') returns a value the button ...
greenway's user avatar
  • 111
0 votes
1 answer
22 views

if we have two html elements named button how we can select the specific element and add style to it using javascript using query selector

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="style.css"> <title>...
NUman's user avatar
  • 1
0 votes
1 answer
18 views

Active class for single class element jQuery

I have these buttons which are actually p elements in a grid and they all have the same class. I would like to change the color of the p element which the user clicks on. How can I add an active class ...
shimmyshimmyya7347's user avatar
0 votes
1 answer
26 views

Why this jQuery selector does not work for me?

I am trying to start an action everytime anything on the webpage else than specific object is clicked (menu "tree horizontal lines" button with class called "navbutton"), like this:...
fafa's user avatar
  • 107
1 vote
1 answer
41 views

jQuery next Input in table

I have a series of input and select elements in a table: <table id='tbl-edit-company' class='tbl-form tbl-contact-form'> <tbody> <tr> <td><...
Edward's user avatar
  • 23
-1 votes
1 answer
28 views

I am trying to write my stored input into a text element on the webpage

I am trying to write an extension that will search the webpage for a specific text element and write my const into it. Some additional context: The process flow is essentially; Pop up prompts user to ...
Michael Blach's user avatar
0 votes
1 answer
75 views

querySelector returns null even though id exists

I am using node.js and typescript to build a website. In one part of the code I am trying to acces an Element with the ID 'likeForm'. This did not work. This is the furthest I got: in movies.ts: ...
Animor Romina's user avatar
0 votes
1 answer
104 views

Call Back IntersectionObserver function for different different id with a single function

I want to create a entrance effects for element when it's on view port for different ids. I have 3 different ids #fadeAppear #slideAppear #zoomAppear with different css property. I want to call a ...
Avro_Abir's user avatar
  • 166
0 votes
1 answer
29 views

Targeting child elements belonging to a specific class using JQuery :nth-child(n) selector

I am trying to apply some CSS classes on a specific html button using JQuery. The button that I am trying to target is the 2nd button in the #left-well div. All the buttons in my html have the class ...
Satyam Rai's user avatar
0 votes
1 answer
16 views

jQuery selector for setting a value of an input based on the current context

I have several inputs that I would like to offer the same jQuery Autocomplete function on. When the user selects an option, I would like to set the value of the corresponding text box to the id of the ...
redaxe's user avatar
  • 13
-1 votes
1 answer
59 views

How to select multiple individual table columns with jQuery?

Currently, my jQuery selector for selecting the 2nd and 7th column is: $("table tr td:nth-child(2) span:contains('something'), table tr td:nth-child(7) span:contains('something')") Is there ...
finefoot's user avatar
  • 10.8k
0 votes
1 answer
431 views

Clone select2 element in current version (4.0.13)

The essence of what I’m trying to do is already asked & answered here in this SO question. That question includes a fiddle and code that works in an prior release of select2 (v3.3.2), but does not ...
B4THC4T's user avatar
  • 49
0 votes
0 answers
68 views

Get text of selector, put into if statement

I'm trying to get the text of this selector (the upload date of a video in the search result): uploadedago: #metadata-line > span:nth-child(4) the text is this: "uploaded x time ago". ...
user avatar
0 votes
1 answer
470 views

Tampermonkey script does not see shadow-root (open) elements loaded by ajax

I am attempting to write a Tampermonkey script in Chrome for a website that I use all the time at work. I want the script to remove the disabled attribute on buttons of a certain class or title. This ...
bakedmcgaked's user avatar
0 votes
2 answers
44 views

I cannot select same class elements with query selector all. I use the VS code editor

In javascript file, I select same class element with query selector all like this... const buttons = document.querySelectorAll(".button"); In html file, I wrote like this... <!DOCTYPE ...
Steven Mine's user avatar
0 votes
1 answer
100 views

Get URL from ahref using Javascript

<a href="#url" data-mc-cta="1" style="display:none">Link</a> In this above a href code, a random URL will be generated by advertising network javascript ...
Mehul Kumar's user avatar
0 votes
1 answer
95 views

How do I find child level element without finding grandchild element with querySelectorAll?

Starting from <ul id="tree_view"> <ul id="tree_view"> <li> <span class="box">Node 1</span> <!-- recursive template --> ...
Peter H's user avatar
  • 13
1 vote
0 answers
233 views

How to work with Tooltips using same ID or class name?

I am creating a page with ~50 lines where single click on a line will copy that line. And there's a tooltip for copy (on hover) & copied (on click). Using the below code, I am able to copy each ...
rTx's user avatar
  • 11
1 vote
1 answer
49 views

Cant Load JS And Stylesheet

I downloaded argon-dashboard the free version to the best of my knowledge, I incorporated it to the system I made. Now it cannot load the JS and stylesheet to a specific page. the link is like this ...
Rex Zednelab's user avatar
0 votes
0 answers
34 views

Select elements by class using wildcard with jQuery/JS

I've seen answers dealing with selecting elements in CSS and I'm wondering if it is possible to perform the following with one line using a wildcard in jQuery? jQuery('.youtube-video-1')[0]....
Line One's user avatar
0 votes
1 answer
47 views

How to select specific paragraph number using JQuery?

I want to select the second paragraph, and can I do that using JQuery but without using an id for the paragraph? Something like accessing a specific node. I tried using $("#p[1]") or $("...
Niki Rich's user avatar
0 votes
2 answers
75 views

How can I select a child element, but separately in jQuery?

I've tried append ul into a div, but all ul append separately in div's. I want just child ul into div Loops selected all ul's into all div's separetly. <li class="first"> <a>...
Tolga's user avatar
  • 56
0 votes
1 answer
19 views

jquery, get the "upper closest" reference from a no direct sibling

look at this structure: i need to get the "upper closest" hidden input reference from wherever i click pay attention: the starting point (where i click) and the target are not direct ...
pinale's user avatar
  • 2,174
0 votes
0 answers
55 views

Visual Studio Code jQuery Selector Preview on Hover

When I hover on a CSS selector, I can see the preview of what it selects (below, first image). I'd like it to work on jQuery selectors as well. Is there a way? I searched through Stack Exchange ...
cagatay117's user avatar
-1 votes
1 answer
70 views

How to select React elements in React.js?

I rendered some elements with a functional component and I'm trying to select some of the elements to log them out to the console, but it logs out null. is there a special method used to select react ...
Vsimdy's user avatar
  • 1
1 vote
0 answers
57 views

How to Filter for data-rel Value on Load with jQuery

The filter on my website needs to have a default value on load. My main JS script uses this, in case it's useful for the solution: window.addEventListener('DOMContentLoaded', event => { //code to ...
Twofreid's user avatar
2 votes
1 answer
257 views

How to get css islolation random string

I use CSS isolation. This is the output html code: <div b-1yc1hoca3 class="test">Text</div> .test { border: 1px solid red; } Random string that CSS isolation generates is: ...
Milad Ahmadi's user avatar
1 vote
0 answers
30 views

How do I make it so only one element is shown at once?

When the box is clicked on the insides for each of the boxes are shown, I only want one to show up at a time. function select() { const outside = document.querySelectorAll('.box') const ...
GenericCucumber's user avatar
1 vote
1 answer
103 views

Remap all jQuery Selectors to shadowRoot

Due to specifications by a customer we are trying to completely replace an iframe element by a a web component with shadow DOM. The plan is, that the website, which should be embeded, is fetched via ...
floorfi's user avatar
  • 41

15 30 50 per page
1
2 3 4 5
181