Line break in Javascript.

Posted by vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 1372
It's very easy to break statement into multiple lines.
By using "+" or "\" sign,we can break one statement into multiple lines

write a function in Javascript as below:-

<script type="text/javascript">
function alert_message()
//1st example
alert("You can easily find a web hosting company that offers"
+ " the right mix of features and price for your applications"
+ " ASP.NET Web Forms lets you build dynamic websites using"
+ " a familiar drag-and-drop, event-driven model.");

//2nd example
alert("Please Select at-least\
one checkbox to process");
<asp:Button ID="btn_alert" runat="server" Text="Multiple Line" OnClientClick="alert_message();"></asp:Button>

Comments or Responses

Posted by: t5j9033387989 on: 11/26/2013 Level:Starter | Status: [Member] | Points: 10
nice one..thanks....

Login to post response