Your syntax is incorrect, you should pass the value as the second parameter:
jQuery(this).prev("li").attr("id","newId");
More Related Contents:
- Not able to get Regular Expression in javascript
- Dynamically adding div on button click and changing Id of each?
- Get specific text from html tag jquery [duplicate]
- How to manage a redirect request after a jQuery Ajax call
- Smooth scrolling when clicking an anchor link
- How to open a Bootstrap modal window using jQuery?
- Trying to fire the onload event on script tag
- Check if element exists in jQuery [duplicate]
- How to show Page Loading div until the page has finished loading?
- Image preloader javascript that supports events
- How can I remove a style added with .css() function?
- Alternative to jQuery’s .toggle() method that supports eventData?
- How to refresh page on back button click?
- Get Character value from KeyCode in JavaScript… then trim
- Convert normal date to unix timestamp
- How to prevent browser to invoke basic auth popup and handle 401 error using Jquery?
- jQuery.proxy() usage
- jQuery live scroll event on mobile (work around)
- Dollar sign before self declaring anonymous function in JavaScript?
- JavaScript: Invoking click-event of an anchor tag from javascript
- How to disable tooltip in the browser with jQuery?
- Scrape web pages in real time with Node.js
- Is setInterval() and setTimeout() bad things to do in modern jQuery animations?
- jQuery/Javascript to detect OS without a plugin?
- Jquery click event not firing on the element created dynamically using jquery
- Changing “src” attribute of
- How to hide optgroup/option elements?
- What is the new proper way to use a child selector with a context node in jQuery?
- Determine distance from the top of a ‘div’ to top of the window with JavaScript
- How to use confirm using sweet alert?