Reputation: 35
When i make a form tag then its input and button come under the current line.And when i write sentence or make a button after form tag then it come under the form tag. i don't want to display input and button on new line. Demo of my code is here.
<form name="apple">
<input max="10000" maxlength="4" min="0" name="banana" size="4" type="number" />
<input onclick="increase ();" type="button" value="View" /></form>
<button onclick="startDownload()">Download</button>
Upvotes: 0
Views: 1769
Reputation: 1039
It's because form
has a display
of block
. To have everything go on the same line use this:
<form name="apple" style = "display:inline">
<input max="10000" maxlength="4" min="0" name="banana" size="4" type="number" />
<input onclick="increase ();" type="button" value="View" /></form>
<button onclick="startDownload()">Download</button>
Upvotes: 4
Reputation: 828
Try this
<form name="apple">
<input max="10000" maxlength="4" min="0" name="banana" size="4" type="number" />
<input onclick="increase ();" type="button" value="View" />
<button onclick="startDownload()">Download</button>
</form>
You had the button outside your form.
Upvotes: 1