How to get this output by jQuery or Javascript:
HTML:
This is a <span class="getClass" >test</span> for javascript and jquery
Then suppose <span class="getClass" >it</span>. how can i change it in multiple line
<span class="getClass" >look</span> like this
Output:
This is a test for javascript and jquery
I have tried some code but it does not work, Like:
<Script>
$('.getClass').unwrap();
</script>
but it delete the parent element not element itself.
I just have class selector access to the element and want to delete the whole element. I can not read the text inside element.
Thank you.
Try this,
Live Demo
If you do not want to change the DOM but only need to get text without span tags then you can use