Change value of literal control by javascript

Change value of literal control by javascript :

Change value of literal control by Js is easy task As we see in old post. How we Access Asp.netLiteral control by Java Script. Now in this post we see how to change text of literal on button client click by java script.
Change value of literal control by javascript :


 For Change value of literal ,Here we use fallowing code.
<script  runat="server">
Sub submit(sender As Object, e As EventArgs)
   Lit1.Text="hello friends this is a Example.!"
End Sub
</script>


We use this Script programming with html Example code:

<script  runat="server">
Sub submit(sender As Object, e As EventArgs)
   Lit1.Text="hello friends this is a Example.!"
End Sub
</script>


<!DOCTYPE html>
<html>
<body>

<form runat="server">
<asp:Literal id="Lit1" Text="hello friends!" runat="server" />
<br><br>
<asp:Button Text="Change Text" OnClick="submit" runat="server" />

</form>

</body>
</html>

In this post we one Literal and one button control of asp.net,the literal control with id Lit1
<asp:Literal id="Lit1" Text="hello friends!" runat="server" />
And Buttton control with id btn.

Other Post:

Popular posts from this blog