473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Button that creates carriage return

I need to create a button that when clicked, starts a new line on the webpage.

At the top of my page, there are buttons. Each time a button is clicked, a word appears, one after the other. I need this button to start a new line, so after this button is clicked, the buttons at the top, when clicked, will output their words in a new line below the previous ones. I've been experimenting with different coding for this button, but so far, nothing has worked.
Apr 17 '15 #1
5 1539
Dormilich
8,658 Expert Mod 8TB
I've been experimenting with different coding for this button, but so far, nothing has worked.
so what have you tried? maybe you were almost there.
Apr 17 '15 #2
Expand|Select|Wrap|Line Numbers
  1. <input type="button" value="Return"
  2.     onclick="document.getElementById('outputDiv').innerHTML=
  3.     <\r>;">
  4. <div id="outputDiv"></div>
This is one of the codes I've tried. Basically, I can't figure what to put after innerHTML.
Apr 17 '15 #3
Dormilich
8,658 Expert Mod 8TB
try \r (without < and >)
Apr 18 '15 #4
Rabbit
12,516 Expert Mod 8TB
You're trying to change the innerHTML to add a carriage return? In HTML, a line break is represented by the tag <br>. But also, you're replacing the entire innerHTML with that, you need to append to it, not replace it.
Apr 18 '15 #5
Expand|Select|Wrap|Line Numbers
  1. <input type="button" value="Return"
  2.     onclick="document.getElementById('outputDiv').innerHTML=
  3.     document.getElementById('outputDiv').innerHTML + \br;">
  4. <div id="outputDiv"></div>
Should it be something more along the lines of this?
Apr 18 '15 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Canes_Rock | last post by:
The information posted at: ...
5
by: Ferdi | last post by:
I have a WebForm with one control: A HTML INPUT control with the property "runat=server" set. If this page is running and I set the cursor in this control and enter "Carriage return", the page...
1
by: Steve | last post by:
I have a simple form with a textbox and a command button, both web form controls (not raw HTML controls). I notice that when the user enters text in the textbox and hits carriage return, the form...
5
by: Dixie | last post by:
Can I program a label with a carriage return to put the 2nd part of the label on a new line. The only way I can see of doing this is to convert the label to a text box, then use chr$(13). dixie
1
by: Wolfgang Schmidt | last post by:
Hello, I have several datagrids in my application. At the moment, data rows which are in editmode can only be saved by clicking the corresponding save button. I would like to add the function...
5
by: Detlev808 | last post by:
Hello, I am attempting to write an awesome perl script. Before it can do anything useful, it must first be able to read in a file, and write out a file (Note: I am NOT talking about text files)....
3
by: HockeyFan | last post by:
I've done this before by trapping keydown and checking for a CR, and then clicking a particular button based on which textbox the event happened. However, I was wondering if there's a simpler way...
1
by: nur123 | last post by:
Thanks in advance who will look at it. I have been encountering an issue which I can’t find a way out of it. What my pgm does: It (java codes) reads oracle table data and creates flat text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.