1,112 questions
-1
votes
1
answer
43
views
Enforce format of data-attribute in vuejs, especially arrays
Is there a way to enforce the format of data-attributes?
Considering the following situation, the returned value is often a string – not an array. splitting is not always desirable, for instance, if ...
0
votes
2
answers
152
views
Is it possible to change the text content displayed in an SVG image by setting specific data-* attributes in the html <svg> tag?
For example, to render the variously changing datetimes of a yearly-repeating event that lasts several days, having a re-usable single svg image that can take a data-datetime="yyyy-mm-dd" ...
0
votes
1
answer
836
views
How to create a 'dynamic` data-attribute, a HTML element with a unique id, in Astro and pass the variables from server to client
In my Astro app I need to pass a variable from the server (frontmatter) to the client.
Like the documentation describe there are two options.
use data-attribute
use defineVars
As far as I can see ...
1
vote
1
answer
55
views
How to add data-autoload, data-origin and data-callback script tags in Angular typescript
I want to add my script in angular application which contains 'data-autoload, data-origin and data-callback' keys. I tried with _renderer2.createElement('script') method but it is throwing error.
...
1
vote
1
answer
80
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
269
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
159
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
1
answer
90
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
44
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
47
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&...
3
votes
1
answer
912
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
53
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
95
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
346
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 ...
-1
votes
1
answer
50
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-...