Last active
March 10, 2019 18:25
-
-
Save thejungwon/530632e21e12aaa86c4511ac96f5bbed to your computer and use it in GitHub Desktop.
This file contains 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
//1. By id | |
var name_by_id = $('#test_id').attr('name'); | |
var class_by_id = $('#test_id').attr('class'); | |
//2. By class | |
var name_by_class = $('.test_class').attr('name'); | |
var id_by_class = $('.test_class').attr('id'); | |
//3. By name | |
var id_by_name = $('[name="test_name"]').attr('id'); | |
var class_by_name = $('[name="test_name"]').attr('class'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment