Questions tagged [custom-data-attribute]
Custom data attributes are intended to store custom data private to the page or application, for which there are no more appropriate attributes or elements.
custom-data-attribute
1,113
questions
0
votes
0
answers
15
views
How to use data attribute values as the context for mark.js?
I'm trying to use Mark.js to find a search value in data attribute values. When a match is found, I'd like to highlight the attribute's element. In the HTML below, I want to highlight .terms, when a ...
1
vote
1
answer
41
views
in Firefox querySelector with attribute while finding path in svg gives error
My code is working well in Chrome but not in Firefox.
When I search path element using querySelector with attribute Firefox gives an error that path is not found.
defs.appendChild(svgGradient);
const ...
0
votes
1
answer
53
views
How do I get multiple data-attributes from a single option select assigned to different javascript variables?
I am trying to assign 2 different javascript variable values from multiple data-attributions in a dropdown menu. One value is working just fine, the other keeps returning null. Any suggestions would ...
-2
votes
1
answer
108
views
Can non data- attributes on custom elements become standard attributes?
In this article the author suggests using data- attributes in the design of a syntax highlighting web component.
The reason given is:
Technically speaking, the browser would let us write the ...
0
votes
0
answers
102
views
React - getting data-attribute from a a form input field based on object key
My company has a web portal with a form on it for people needing help with accessibility to contact the company. Our company is now switching to React and I am trying to create the same form with the ...
0
votes
1
answer
46
views
Jquery DataTable update `data-sort` attribute at runtime not affecting sort
I have a datatable which has checkboxes in first td
some are coming checked while some are unchecked from database
by default it is not sorting checked/unchecked, so I also added data-sort attribute
...
0
votes
0
answers
37
views
jQuery data-attribute to object with stringify reversing on newer versions
When retrieving the data-attribute on a HTML element I have run into a problem using jQuery.
I wish to manipulate the attributes and some elements have more data-attributes than others.
Using jquery-1....
1
vote
1
answer
37
views
how to remove a tr where td has a certain data-attr value
I am trying to remove a tr from DOM after ajax success where td of this tr has a certain data-value value
This is the html:
<tr>
<td data-value="1">First</td>
</tr&...
0
votes
1
answer
154
views
Does React's type declarations e.g. React.HTMLAttribute<HTMLButtonElement> support the usage of custom data attributes out of the box?
I'm trying to create an object that can be spread into a React Component and this object has to include an HTML Custom Data Attribute.
import { HTMLAttributes } from 'react'
interface FooProps ...
0
votes
1
answer
43
views
How to display some CSS content for div[data-attr="false"]:first-ot-type?
Is is possible to display "HEADER FOR OLD DATA" only for the very first row of OLD data and not repeating it for each (in the same way blue border is not repeated)?
Considering (1) has been ...
0
votes
1
answer
47
views
On hover get img src specified in a `data` attribute, then add an img + path to another div
I have a javascript cursor, which does quite a few different things (hence a few different blocks of similar looking code), where on hover it will add classes to the cursor divs so it can be ...
0
votes
5
answers
172
views
Function to find out children of multiple HTML elements and use as custom attribute
So I have the following structure with multiple <div> elements where I want to display the children inside each of it in a data attribute (data-children). Instead of manually changing the ...
0
votes
0
answers
61
views
Create custom sharable data within a microsoft graph api event
Currently, I'm creating a new event by using the ms graph api with user_1, user_2 can accept this event and also receives the event.
MS graph api Events endpoint:
https://graph.microsoft.com/v1.0/me/...
-1
votes
1
answer
44
views
jQuery filtering divs based on multiple data attributes
I have multiple divs on a page, each with the following data attributes: data-one, data-two, data-three, data-four & data-five. The following code is creating a filterList array like so: ['one-...
0
votes
2
answers
41
views
How to compute the total amount of all selected options' custom "data-price"-attribute values?
I'm trying to get values from the options of my select-element. It is possible to select any option, and each option features some custom data-* attribute like e.g. ...
<option value="1" ...