how to swap two images in javascript
<img src="ble.jpg" id="F" data-value="" onclick="swap(5)" />
<img src="ilk.jpg" id="4" data-value="2" onclick="swap(6)"/>
var img_1_value = document.getElementById("F").getAttribute('data-value');
var img_2_value = document.getElementById("4").getAttribute('data-value');
document.getElementById("F").setAttribute('data-value', img_2_value);
document.getElementById("4").setAttribute('data-value', img_1_value);
Also in JavaScript:
- jquery if attribute
- oauth2 spring boot react google example
- how to add multiple styles in javascript
- javascript copy an object without reference
- firebase contains query realtime
- get installed plugins in a browser via javascript
- react Spread Attributes conditionally
- setting multiple styles in javascript
- javascript remove first space in string
- get every other item in an array
- node js module require multiple functions from one node
- chrome back button click event react
- check if object is present in array javascript
- foreach object javascript
- cascading dropdown for forms react
- getting value from radio button javascript
- js is variable int
- splice from array javascript to remove
- check unique object in array javascript site:stackoverflow.com
- js combine two arrays
- how to detect if app is loosing focuse in react native
- discord.js lockdown command
- loop json object android java
- ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: [object Object]'. Current value: 'ngIf: true'.