Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get the class name dynamically using jquery

var classArray = $('input').attr('class').split(' ');
// So now you can declare variables
var classbtn1 = classArray[0];
var classbtn2 = classArray[1];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #class #dynamically #jquery
ADD COMMENT
Topic
Name
4+7 =