i want to append a text into an input value using jquery, i dont want to use val() :
The code :
<span>L'objectif de ce cours est d'introduire</span>
<script>
$(document).ready(function(){
var tb = $("span").text();
console.log(tb); // L'objectif de ce cours est d'introduire
$("body").append("<input value='"+tb+"'>");
});
</script>
but i get just L into the input, what is the exact problem, i think the cause is that char ' , please help me fix it, and thnx !