You want:
this.value=""; // straight JS, no jQuery
or
$(this).val(''); // jQuery
With $(this).value=""
you’re assigning an empty string as the value
property of the jQuery object that wraps this
— not the value
of this
itself.
More Related Contents:
- Why am I getting an OPTIONS request instead of a GET request?
- jQuery get value of select onChange
- jQuery autocomplete tagging plug-in like StackOverflow’s input tags? [closed]
- How to detect if two divs touch with jquery?
- Select deepest child in jQuery
- jqGrid get “th” and “thead” using jQuery
- How do I hide an element on a click event anywhere outside of the element?
- JavaScript: Changing src-attribute of a embed-tag
- jqgrid client side sorting with server side paging – data disappears
- jQuery: keyPress Backspace won’t fire?
- More efficient way to handle $(window).scroll functions in jquery?
- jquery, add/remove class when window width changes
- How to call .ajaxStart() on specific ajax calls
- Add CSS to iFrame [duplicate]
- How to update value of data in jqgrid
- jquery load() strips script tags – workaround?
- HTML5 Video autoplay on Mobile Browser
- Return Partial View and JSON from ASP.NET MVC Action
- Remove span tag in string using jquery
- jquery get height of iframe content when loaded
- Difference between $.ajax(); and $.ajaxSetup();
- Does Google crawl AJAX content? [closed]
- How to add jQueryUI library in MVC 5 project?
- jQuery resize not working at FireFox, Chrome and Safari
- Jquery post and unobtrusive ajax validation not working mvc 4
- Detect user scroll down or scroll up in jQuery [duplicate]
- How do I select an element with special characters in the ID?
- Get bottom and right position of an element
- Why return this.each(function()) in jQuery plugins?
- jqGrid with automatic height; but has a max height & scrollbars