My code as follows
In my run mode as follows
In my run mode as follows
Hello (Input type)
lblmsg The data does not match
When i type the text in Input type, i want to clear the lblmsg text the data does not match.
for that how can i do in asp.net
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Midhun TpRank #388 · 6.5K reputationPosted Sep 11, 2016, 6:39 AM EDT
Rahul SinghRank #4,330 · 350 reputationPosted Sep 11, 2016, 7:15 AM EDT
<body>
<input type = "text" id="Empid" Placeholder = "Hello" runat="server" onchange="myFunction()">
<asp:Label ID="lblmsg" runat="server" Text=""></asp:Label>
<script>
function myFunction() {
var x = document.getElementById("Empid").value;
document.getElementById("lblmsg").innerHTML = "You selected: " + x;
}
</script>
</body>
</html>