I would like to add an ellipsis to the placeholder attribute of the input element using jQuery prop(), but instead of the intended one, …I get a literal string ….
How can I add html objects by name using jQuery prop()?
$(document).ready(function(){
$('div#b input').prop('placeholder','Search…');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<div id="a"><input type="text" placeholder="Search…" /></div><br />
<div id="b"><input type="text" /></div>
Run codeHide result
source
share