I need to map the <input> value to <span> , and when the label becomes blank, change the range value to “Video title”. But I always enter something into <input> and then delete it, the value of <input> still has the value "", so <span> does not display anything. Thanks for the help. (And sorry for my bad english)
Here is my code:
$("#newVideoName").keyup(function(){ var newVideoName = $("#newVideoName").val(); if(newVideoName == ""){ $("#newVideoNameLabel").html("Video title"); } }); <input type="text" id="newVideoName"> <span id="newVideoNameLabel"></span>
source share