Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
43 views

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 ...
WoodrowShigeru's user avatar
0 votes
1 answer
858 views

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 ...
meez's user avatar
  • 4,888
1 vote
1 answer
80 views

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 ...
Muhammad Amir's user avatar
-2 votes
1 answer
159 views

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 ...
Ole's user avatar
  • 48.2k
0 votes
0 answers
44 views

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....
London28's user avatar
3 votes
1 answer
925 views

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 ...
geoyws's user avatar
  • 3,757
0 votes
1 answer
96 views

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 ...
user1406440's user avatar
  • 1,677
-1 votes
1 answer
50 views

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-...
onesixty's user avatar
2 votes
0 answers
1k views

I use ReactJS v18.2 with react-select v5.7. I want to add a custom attribute (e.g. data-test) to the input element of my <Select/> component, I could not find something like this in the docs. ...
tverdo's user avatar
  • 170
1 vote
3 answers
1k views

I want to create an element like the following with JavaScript: <div data-boolean-attribute></div> Passing null or undefined to setAttribute() or the dataset property results in a value ...
ForExampleTheCat's user avatar
0 votes
1 answer
834 views

I have pet website developed in shopify and I have requirement that create custom form in shopify and store custom form data in shopify default customer table. As shopify do not provide database ...
Ravi Thanki's user avatar
0 votes
1 answer
87 views

i'm creating a list of links dinamically from the sections i have: $sections.forEach(({ id, firstElementChild: { textContent } }) => { const link = document.createElement('a'); link....
Facundo's user avatar
  • 23
4 votes
1 answer
318 views

I'm using version 5.2 of Bootstrap. I'm trying to use the fallbackPlacements option of the Tooltips plugin. The problem is that fallbackPlacement takes an array, but doesn't seem to accept one through ...
Hashim Aziz's user avatar
  • 6,576
0 votes
1 answer
705 views

I pulled the class names and x,y points I needed from the json file and created a csv file. This csv file contains rows for multiple regions for each image. For example, while there are 5 regions for ...
ebruk's user avatar
  • 1
0 votes
1 answer
87 views

This has been driving me crazy. Couldn´t get a definitive answer from chatgpt nor reddit. Maybe stackoverflow has someone who is willing to help me out or give guidance. Description: When button is ...
ints's user avatar
  • 67
0 votes
0 answers
71 views

I have a script that shows a Div (incorporating a checkbox) that shows if a data-attribute select dropdown selection is more than 18 (for age verification for that option). The problem is if you ...
glennyboy's user avatar
  • 163
0 votes
2 answers
271 views

I have a list of articles with different categories (ex: aaa, bbb, ccc). I want to display the sum of the data-prices for each category For example, I should have 3.20 for aaa, 10.20 for bbb, and 11....
phil1's user avatar
  • 3
0 votes
1 answer
233 views

I am developing an Angular application and am using Bootstrap 5.2. I am using the Collapse component on a card and it works perfectly using the data attributes. However, I want to trigger the collapse ...
Carl Rezelman's user avatar
0 votes
0 answers
73 views

I need to store data (a string) on a certain HTML node. This can be done via the dataset object document.body.dataset.foo = 'bar'; Given the nature of JS however, node instances are also (just) ...
LukasKroess's user avatar
-1 votes
1 answer
51 views

I've write some HTML data-attribute code and added HTML tag inside. But I can't design them without adding any class name. For example; this is my data-attribute; <div data-box="<h1 class='...
Asma Binta Younus's user avatar
1 vote
3 answers
3k views

Let say I have a parent div with the id of "container" and it has four children with specific data attribute named data-test. How do I check if each child is in the right order? Let's say ...
Twirlman's user avatar
  • 1,167
0 votes
2 answers
650 views

I have a html/js code that takes data from a json and render it to html table. It has been working fine for a while. Recently the number of items being handled has greatly increased and can't afford ...
sigfried's user avatar
0 votes
1 answer
844 views

I understand that I can add a data-attribute to an element within my component like this: <div [attr.data-my]="myDataValue"> But how can I add a data-attribute to the component itself?...
Frank Jusnes's user avatar
1 vote
2 answers
1k views

I have some data attributes on buttons that I need to send as content to a div when those buttons are clicked. A part of my code until now is this: function getDiscount() { var buttons = ...
kyllaz's user avatar
  • 59
1 vote
2 answers
3k views

How can I set data-* attributes of a div dynamically via an array or object in Vue.js? I found out that it is possible to set attributes dynamically via the data attributes or via calculated ...
Laberkopf's user avatar
  • 117

1
2 3 4 5
23