Is there any alternative for .closest() ?
Hi all,
I'm looking for an alternative for .closest(). My script refers to jQuery 1.3.2 which is not the latest, but does its job. By trying to implement my code into another script I noticed that this script uses jQuery 1.2.6. Well, 'changing that version was no option'.
- var statTested = $("h1:contains('mystatus')");
- if (statTested.length > 0) {
- var containingIn = $("p:contains('In [')");
- if (containingIn.length > 0){
- $("<div id='createDiv' style='border:1px outset #999966;padding:1em;margin-top:1em'>Alle Changesets:<br></div>").insertAfter("#changelog");
- var containingRew = $("li:contains('text')").css('margin-left','1em');
- if (containingRew.length == 0){
- $("#createDiv").append($("p:contains('In [')").closest("div").clone());
- }
- else{
- $("#createDiv").append($("p:contains('In ['),'li:contains('text'):last'").closest("div,li").clone());
- }
- }
- }
This is my code. It should be used to clone special comments containing "In[" and in some cases "text".
Unfortunately .closest() doesn't work out for me. i'm looking for an alternative.
I#d be thankful for any hint and help.