Answers for "get class name"

PHP
6

php get class name of this

get_class($this);
Posted by: Guest on March-22-2020
1

javascript get class name

document.getElementById("myDIV").className = "mystyle";
Posted by: Guest on April-07-2021
3

get name of class javascript

myObj.constructor.name
Posted by: Guest on December-19-2020
1

how get class name

String className = this.getClass().getSimpleName();
Posted by: Guest on February-05-2021
0

java class name to string

String className = n.getClass().getName();
String name = className.substring(className.lastIndexOf('$')+1,className.length()-4);
System.out.println(name);
Posted by: Guest on November-16-2020
0

how to get class name of element in javascript

var spans = document.getElementsByTagName("span");
for (var i = 0; i < spans.length; i++) {
    if (spans[i].className == 'xyz') {
        spans[i].style.backgroundColor = '#000';
    }
}
Posted by: Guest on July-15-2021

Browse Popular Code Answers by Language