this sounds really simple and stupid..but I’m having a hard time removing the content before each dash from each H4 element on my page….i’ve been trying to do this with Jquery/Javascript.. Any insight?
Here’s a sample of my HTML code:
<h4>California-Medical Research</h4>
<h4>Florida-Industrial</h4>
<h4>Atlanta-Computers</h4>
I’m trying to have my code cycle through each occurance of <h4> and remove everything before the dash…so the desired result will look like this:
Medical Research
Industrial
Computers
Thanks!
Assuming your layout’s consistent with dashes you could do this:
Since jQuery 1.4+
.text()takes a function, making this very clean. You can give it a try here.