I have a div:

<div id="crop"><span> text - 123 views</span></div>

I want crop from "-" to "v" ,thanks

  • 1
    can you explain what you are wanting to do a little better. The term crop is to remove something like crop an image but i do not quite get crop from - to v. Also is the div user created or wordpress plugin core created. – xLRDxREVENGEx May 13 '11 at 3:47


var $span = $('#crop').find('> span');

    $span.text().replace(/^[\s\S]*-\s+(\d+)\s+[\s\S]*$/m, '$1')
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.