...

View Full Version : How to put break in javascript mm_menu code



Elbee
07-18-2012, 01:08 PM
Hello,

How can I put a break in the following code so that the end result is:

Olga L. Bradham &
Etta L. Brooks Branch

[CODE]mm_menu_hours_0.addMenuItem("Olga L. Bradham & Etta L. Brooks","location='/lib/branches/nw.html'");
</CODE>

Thanks for your help,

Elbee

I made two lines:

[CODE]
mm_menu_hours_0.addMenuItem("Olga&nbsp;L.&nbsp;Bradham&nbsp;&amp;&nbsp;Etta&nbsp;L.&nbsp;Brooks","location='/lib/branches/nw.html'");
</CODE>
[CODE]mm_menu_hours_0.addMenuItem("&nbsp;&nbsp;&nbsp;Etta&nbsp;L.&nbsp;Brooks","location='/lib/branches/nw.html'");
</CODE>

Was there a different way I could have done it? Thanks.

MarPlo
07-18-2012, 02:39 PM
Hi
If you want to add new line in JS code, use "\n":

mm_menu_hours_0.addMenuItem("Olga&nbsp;L.&nbsp;Bradham&nbsp;&amp;\n&nbsp;Etta&nbsp;L.&nbsp;Brooks","lo cation='/lib/branches/nw.html'");
If you want a HTML <br>, try this:


mm_menu_hours_0.addMenuItem("Olga&nbsp;L.&nbsp;Bradham&nbsp;&amp;<br>&nbsp;Etta&nbsp;L.&nbsp;Brooks","lo cation='/lib/branches/nw.html'");

Elbee
07-18-2012, 03:43 PM
Thank you so much!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum