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
2 answers
176 views

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" ...
WebDragon's user avatar
  • 945
0 votes
1 answer
872 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
57 views

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. ...
Bhushan Khaladkar's user avatar
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
0 votes
1 answer
278 views

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 ...
Marc AMM'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
1 answer
91 views

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 ...
alamnaryab's user avatar
  • 1,492
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
1 vote
1 answer
49 views

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&...
Jack Maessen's user avatar
  • 1,871
3 votes
1 answer
931 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
55 views

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 ...
charnould's user avatar
  • 2,965
0 votes
1 answer
98 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
0 votes
5 answers
348 views

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 ...
Marcos Cuadros's user avatar
-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
0 votes
2 answers
60 views

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" ...
scorpions77'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
1 answer
459 views

I am trying to use custom data in the texttemplate of a Heatmap in Plotly, but it does not seem to work. I am using Python 3.10.12 and Plotly 5.15.0. Below there is a MWE: import plotly.express as px ...
user171780's user avatar
  • 3,245
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
52 views

Is it possible to get the data attribute value during an on change event? jQuery(document).ready(function($) { $('.mystatus').on("change", function() { var value = this.value; ...
shanebp's user avatar
  • 1,946
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
5 votes
1 answer
3k views

Consider this: import type { JSX } from 'react'; const MyComponent = (): JSX.Element => ( <div data-attr="bar">Foo</div> ); This does not give any TypeScript error which ...
Aelita's user avatar
  • 79
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
1 vote
2 answers
90 views

I found a lightweight lightbox code example, however, it relies on IDs and I intend to use it on 20+ items, I'd rather not have 20 hard-coded js lines to refer to something I know can be dynamic, I'm ...
Joshua Schmitz's user avatar
4 votes
1 answer
320 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
-1 votes
1 answer
76 views

My Problem with this code is that i want to get the values of my data-Attributes and to know if it worked i use the alert function to see if it gets it. Now comes the Problem, each time i call a ...
Damian Iturri's user avatar
0 votes
1 answer
706 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
0 answers
49 views

I want to put a link in my Tooltip Text, like for example: <div tooltip="Look at following: <a href='https://google.com/' target='_blank'>Website</a>" flow="right"&...
nanchalantflow's user avatar
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
1 answer
79 views

I have been struggling to get round an issue with filtering multiple data attributes that I have stored in an array. I have 2 different filter types (filter topic and filter content type) topics being ...
philipjnorton's user avatar
0 votes
0 answers
74 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
-1 votes
4 answers
337 views

I want to use 6 of these Before/After Audio Players on my website: https://github.com/mattbartley/AB-Audio-Player However, the sources of the audio files are set in the JavaScript code. So when I ...
Calimeh's user avatar
0 votes
2 answers
272 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
0 answers
36 views

Current Issues: 1-By Default the First Main Tab with data-tab="1" and First Sub Tab with the data-tab="1" and the Inputs related to First Sub Tab with the data-tab="1" ...
Omer Butt's user avatar
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
1 answer
46 views

As you can see I am using data attributes to load the div DataSet_Data with a partial view returned from that url.action. It loads on page load correctly hitting the data-url and loads the correct ...
Snake3ite's user avatar
0 votes
0 answers
74 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
0 votes
1 answer
754 views

I'm developing custom event tracking on my website using Custom Data Attributes (data-*) in the HTML code. The data collected should be sent to Google Analytics using Google Tag Manager (that enables ...
WhoCares'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
0 votes
1 answer
127 views

when I working with data attribute, it's accept regular html tag. But not accepting child classes. For example, look at my first code; <p>Lorem ipsum <a href="#" class="mi-...
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
-2 votes
1 answer
120 views

Which format do you recommand for passing an array of hash in a Html data attribute. For instance: <button data-products="[{ id='1', name='A Product Name', ...
Benjamin J. B.'s user avatar
0 votes
2 answers
652 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
109 views

Im trying to order a list of a custom datatype with different size of atributes to validate if the datatype format is true but I don't know how to manipulate it by using quick sort. The datatype: data ...
Gabriel Brito de França's user avatar
0 votes
1 answer
851 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
2 votes
1 answer
541 views

I am working on Razor Page (.NET Core 6) and trying to store data in html data attribute. The problem is that: if the data is the string from C# code and it has whitespace, the string will be split by ...
Pawich S.'s user avatar
  • 455
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
0 votes
1 answer
576 views

I'm calling an api with Kotlin and Ktor to get a book in return as json response. From this response I want to load the book cover in my frontend Freimarker .ftl file. I'm doing this call in ...
nicowi's user avatar
  • 472
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
0 votes
1 answer
59 views

I am generating an array of woocommerce attributes with the following code: $customAttributes = array(); $attributes = $product->get_attributes(); foreach($attributes as $attr=>$...
Ahmad Wahid's user avatar

1
2 3 4 5
23