Howdy — Long time reader, first time questioner. 🙂
I could really use some assistance replacing part of a string in jQuery 1.5.2.
Loaded into a variable will be this string:
<div class="reply">
<a class="comment-reply-link" href="http://someurl/foo/testing-post-four/?replytocom=5#respond" onclick='return addComment.moveForm("comment-5", "5", "respond", "8")'>Reply</a>
</div>
Unfortunately, the string won’t be as clean as this. WordPress generates it, which means the HTML will contain an absurd number of extra spaces and tabs. The comment value will fluctuate.
I’m looking to replace the bit “comment-5” with another string variable – one that will likely be along the lines of comment-12345 — no quotes, as it will be pulled from the ID of a neighboring DIV.
Thoughts?
Thanks for the brain power!
Are you able to simply use javascripts inbuilt replace function?
Or are you reffering to how you can replace the ID? In which case