I want to set input type value blank which i just passon name attribute. for example
1) Multiline:
$('input[name="library"]').val('');
$('input[name="books"]').val('');
$('input[name="author"]').val('');
2) Single Line:
$('input[name="library"],input[name="books"],input[name="author"]').val('');
above both line is working for me. But I want more optimize way. Is there any way to write it like as follow
$('input[name="library"][name="books"][name="author"]').val('');
and it will blank all 3 input fields blank?
One more thing, I am getting these all input fields from other server, and I am not able to change input fields class on their server. So i just want to replace some of input fields on my side that i explain above.
$(':input').filter('[name="library"][name="books"][name="author"]').val('');?:inputis an extension that is not part of the CSS specification, queries using :input cannot take advantage of the performance boost provided by the native DOMquerySelectorAll()method but the best performance is achieved by first selecting the elements using a pure CSS selector, then using.filter(":input").