Home › Forums › JavaScript › JavaScript / Jquery to elide part of a figcaption element › Reply To: JavaScript / Jquery to elide part of a figcaption element
October 24, 2015 at 11:20 pm
#210142
Shikkediel
Participant
Fiddled around with it a bit, this should work when it is the first occurrence of the class source
:
var item = document.querySelectorAll('.source'),
text = item[0].innerHTML.substring(1);
item[0].innerHTML = text;