Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery get text of element without child elements

$("#foo")
    .clone()    //clone the element
    .children() //select all the children
    .remove()   //remove all the children
    .end()  //again go back to selected element
    .text();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #text #element #child #elements
ADD COMMENT
Topic
Name
2+3 =