html - Javascript - get span by the class? -
possible duplicate:
how element class in javascript?
i need text inside of span. span has no id. has class. there 1 span class. know how can span element in javascript? thanks!
<span class="galleria-current">1</span> this different how element class in javascript? asking more generic "get element class", in case there's easier way spans, plus question replacing text, whereas want get innerhtml in case.
yes, can use document.getelementsbyclassname().
this return array of elements classname. first 1 accessed this:
var span = document.getelementsbyclassname("galleria-current")[0]
Comments
Post a Comment