Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

data-item-id

// Here's our buttonvar button = document.getElementById('your-button-id'); // Get the valuesvar cmd = button.getAttribute('data-cmd');var id = button.getAttribute('data-id'); // Change the valuesbutton.setAttribute('data-cmd', yourNewCmd);button.setAttribute('data-id', yourNewId);
Comment

element data-id

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>

<ul id="list" class="grid">
  <li data-id="id-40" class="win">
    <a id="ctl00_cphBody_ListView1_ctrl0_SelectButton" class="project" href="#">
      <img src="themes/clean/images/win.jpg" class="project-image" alt="get data-id" />
    </a>
  </li>
</ul>
 Run code snippetHide result
Comment

PREVIOUS NEXT
Code Example
Javascript :: react $ r component instance console 
Javascript :: regex to get part of word nodejs 
Javascript :: mvc form client side validation result callback 
Javascript :: coment executer des touche de clavier avec du js 
Javascript :: select with row id d3.js 
Javascript :: vue change input value from console 
Javascript :: svn node remains in conflict 
Javascript :: nuxt vuetify google fonts undefined 
Javascript :: how to get state value from history react 
Javascript :: facebook game files example 
Javascript :: react generate ethereum address 
Javascript :: how to get 3rd level form data by $refs in vue 
Javascript :: ar.js getting started 
Javascript :: syntax to call item from array 
Javascript :: prevent adding the item twice in an array javascript 
Javascript :: jquery copier dans le presse papier 
Javascript :: create javascript array from datalist dynamically 
Javascript :: javascript ajax show result type min 3 characters 
Javascript :: concept of node js with react js 
Javascript :: how to add make touchstart passive in jquery "3.4.0" 
Javascript :: firebase angular send notification to by tocken 
Javascript :: toastr js dont fade out 
Javascript :: Ajax send date to MVC 
Javascript :: click and copy jquery dynamic content 
Javascript :: react native multiple touchableopacity 
Javascript :: snippets chrome devtools debugging 
Javascript :: redux filter pane 
Javascript :: code postal leheriya tunisie 
Javascript :: How to get a factorial number 
Javascript :: fiter on redux state 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =