custom-data-attribute Questions
7
Solved
How can a JavaScript array be stored in an HTML custom data attribute?
I've tried every variation of JSON stringification and escaping characters.
What is the precise method to store the array and ...
Oversubtlety asked 25/4, 2013 at 20:6
6
Solved
I've an element in the DOM:
<a href="#" data-a="1">Link</a>
I want to get this element via its HTML5 custom data attribute data-a. So I write JS codes:
var a = document.querySelector...
Nisa asked 11/2, 2013 at 9:46
8
Solved
How long is too long for an attribute value in HTML?
I'm using HTML5 style data attributes (data-foo="bar") in a new application, and in one place it would be really handy to store a fair whack of...
Grappling asked 30/9, 2009 at 4:19
2
Solved
I've been trying to use feather-icons in a new vue project.
I first initialized the project using the vue-clie tools:
vue init webpack
once done, I ran:
npm install
npm run dev
After that I i...
Afterdamp asked 6/7, 2017 at 22:20
1
Solved
First steps in Angular (with Material at version 9). I'm creating a form with the following code:
HTML:
<mat-form-field>
<mat-label>Course</mat-label>
<mat-select
[formCon...
Diminish asked 23/2, 2020 at 14:56
0
Today, in a blog post entitled More options to help websites preview their content on Google Search, Google announced new behaviour for the Google search engine. The part that interests me is that ...
Gamo asked 25/9, 2019 at 10:54
3
Solved
Basically I have 3 custom attributes data-pageName, data-defaultOption, data-options.
The problem I have is that when I pass into my child component I get an unexpected token error because its som...
Whorish asked 3/8, 2016 at 9:53
6
Solved
We know such syntaxes as below, when defining a value for onClick attribute:
<button type="submit" onclick="alert('hi');"></button>
<button type="submit" onclick="doWork"></bu...
Macnair asked 4/5, 2015 at 10:54
3
What is the difference in usage between $.data and $.attr when using data-someAttribute?
My understanding is that $.data is stored within jQuery's $.cache, not the DOM. Therefore, if I want to use...
Overpass asked 31/8, 2011 at 18:26
7
Solved
So jquery api says the following:
Removing data from jQuery's internal .data() cache does not effect any HTML5 data- attributes in a document; use .removeAttr() to remove those.
I have no pro...
Biarritz asked 23/1, 2012 at 8:23
3
I have a WordPress multisite set up and am trying to save page content with data-attributes on some html tags. Super Users are able to save with no issue, however when Administrators or lower roles...
Crispa asked 31/7, 2018 at 1:5
3
Solved
I'm using garlic.js to validate my forms. Garlic.js recommends adding a data-attribute on the form tag.
Here's what I need to generate:
<form data-validate="parsley">
I'm having issues to...
Karolyn asked 13/5, 2013 at 20:59
4
Solved
I am making a Table.
document.querySelector('table').addEventListener('click', (e) => {
console.log(e.target);
console.log(e.target.dataset.item);
})
td {
padding: 8px;
border: 1p...
Jagged asked 12/12, 2018 at 12:58
7
Solved
I've got the following field on an MVC view:
@Html.TextBoxFor(model => model.Course.Title, new { data_helptext = "Old Text" })</span>
In a seperate js file, I want to set the data-helpt...
Appoggiatura asked 26/7, 2011 at 9:15
3
Solved
Couldn't find this anywhere, maybe someone knows or can make a suggestion.
I had a form with lots of <inputs>, I wanted to send that form with jQuery $.ajax functionality, so I did $('#myfor...
Emulous asked 23/8, 2012 at 22:8
4
Solved
I would like to know what selectors are available for these data attributes that come with HTML5.
Taking this piece of HTML as an example:
<ul data-group="Companies">
<li data-company="...
Hilel asked 10/11, 2010 at 16:15
2
Solved
I have attribute names stored somewhere in a string and need a way to create corrected names to use with dataset api. I get the names of those in attribute style, like data-attrib-name. So I need t...
Gothurd asked 26/6, 2018 at 13:49
5
Solved
HTML file:
<div class="test" data-word="AAA" data-type="T" data-number="1"> Text 1 </div>
<div class="test" data-word="AAA"...
Unmixed asked 22/12, 2014 at 19:56
9
Solved
I've got the following scenario:
var el = 'li';
and there are 5 <li>'s on the page each with a data-slide=number attribute (number being 1,2,3,4,5 respectively).
I now need to find the cu...
Bundelkhand asked 16/11, 2010 at 5:11
2
Solved
In a HTML5/JS application we have a view with some styles depending on the data-attribute of elements:
like
<li data-level="0"></li>
or
<li data-level="1"></li>
CSS
...
Debauch asked 31/7, 2013 at 9:59
1
Solved
given this input
.prettyRange {
-webkit-appereance: none;
}
.prettyRange::-webkit-slider-runnable-track {
background: -webkit-linear-gradient(right, #fff 0%, green 50%, #fff 0%);
}
&...
Athodyd asked 20/4, 2018 at 7:39
2
Solved
I try to add conditionally a data attribute value to my vue list on loop and I try the following
<ul data-parent="{{model.parent_id !== null ? model.parent_id : 0}}"></ul>
but in th...
Tonie asked 14/9, 2017 at 11:17
6
Solved
$('div').data('info', 1);
alert($('div').data('info'));
//this works
$('div[data-info="1"]').text('222');
//but this don't work
I'm creating element within jquery. After that, I want to add at...
Elaterite asked 18/2, 2013 at 11:26
2
Solved
Ive got button that is closing bootstrap modal as below:
<button id="back_offer_button" type="button" class="btn btn-default" data-dismiss="modal" data-toggle="modal" data-target="#addOffer">...
Logistician asked 25/10, 2017 at 16:17
3
Solved
I'm running into a problem with data* attributes in knockout.js ie. writing them out with attr.
I can do this without a problem:
<input data-bind='text: Title, attr: {name: "Events[" + viewMod...
Catechize asked 23/1, 2013 at 1:26
© 2022 - 2024 — McMap. All rights reserved.