Created
July 4, 2020 07:35
-
-
Save rwaddin/daef6cc8a9b2d8bd9d6c37a4e0efff01 to your computer and use it in GitHub Desktop.
add, remove class javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var el = this.$refs[index][0]; // your element | |
if (el.classList.contains("btn-added")) { | |
el.classList.remove("btn-added") | |
el.innerHTML = "order" | |
}else{ | |
el.innerHTML = "batal" | |
el.classList.add("btn-added") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment