These don't work:
jQuery(this).prev("li").attr("id")="newid"
jQuery(this).prev("li")="newid"
I found out that I can make it happen with the following code:
jQuery(this).prev("li")show(function() {
this.id="newid";
});
But that doesn't seem right to me. Is there any better way? I need to change an element's ID using jQuery.