Splitting Long Messages to display in a New Line using Javascript.

vishalneeraj-24503
Posted by vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 562
In C#,we use \r\n for new line ,so the same we can apply in Javascript too.
Refer below code:-

<script type="text/javascript">
function Split_messages_into_new_line()
{
var alert_msg1 = "Message1"
var alert_msg2 = " Message1";
var alert_msg3 = " Message1";
var alert_msg4 = " Message1";

alert(alert_msg1 + "\r\n" + alert_msg2 + "\r\n" + alert_msg3 + "\r\n" + alert_msg4);
}

</script>

<asp:Button ID="btn_alert" runat="server" Text="Split Messages" OnClientClick="Split_messages_into_new_line();"></asp:Button>

Comments or Responses

Login to post response