Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9171889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:13:28+00:00 2026-06-17T16:13:28+00:00

I am trying to show innerHTML after textbox in Javascript but it always ends

  • 0

I am trying to show innerHTML after textbox in Javascript but it always ends up under the textbox, like so:

[ textbox ]

Please enter username

but I want it like this

[ textbox ] Please enter username

   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>his Website</title>

<link href="default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="libs/JQuery.js"></script>
<script type="text/javascript" src="libs/effex.js"></script>
<script type="text/javascript" src="libs/slide.js"></script>
<script type="text/javascript" src="libs/jquery-ui.js"></script>

<script type="text/javascript">
function chck() {
    var name = document.getElementById('name').value;
    var msg = document.getElementById('msg');
    var namex = document.getElementById('name');
    if (name == '') {
        namex.innerHTML=namex.innerHTML+msg.value;
        document.getElementById('msg').innerHTML = "Please enter name to proceed...";
return false;
    }
}
</script>
<body bgcolor="silver">
<table width="1500" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><img src="images/bann3r.jpg" class="copy" width="1500" height="150" usemap="#Map" border="0" /></td>
  </tr>
</table>
<center>

<div id="bod">
<br />

<legend class="contact">Contact Me!</legend>
<fieldset>
<form name="contact">
<br />
<br />
<br />
<label>Name:</label><input name="name" type="text" class="nameTxt" id="name" maxlength="20"/><label id="msg"></label>
<BR />
<label>Email:</label><input type="email" name="email" class="nameTxt" />
<BR />
<label>Subject:</label><input type="text" name="subject" class="nameTxt" />
<BR />
<label>Message:</label><textarea name="msg" class="nameTxt"></textarea>
<Br />
<br />
<input type="submit" value="Send Message" class="send" onClick="return chck()"/>
</form>
<fieldset>
</div>

<map name="Map" id="Map">
  <area shape="rect" coords="177,62,274,104" href="index.html" />
  <area shape="rect" coords="322,52,534,111" href="gdesigns.html" />
  <area shape="rect" coords="1305,58,1478,106" href="contactme.html" />
</map>
</body>


<center>
<div id="hoverdiv">Contact</div>

<br />
<br />
<br />
<footer><font face="Arial, Helvetica, sans-serif" hovertext="Copyright Yousef Bhatti">©Copyright 2013 Yousef Bhatti</footer></font>
</center>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:13:29+00:00Added an answer on June 17, 2026 at 4:13 pm

    make sure that css given to that label is

    #msg
    {
      position:relative;
      display:inline-block; //if this doesn't work, give float:right;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to show a simple countdown from 2 hours like so: $(function ()
I'm trying to use qtip2 . My problem is that I want to show
I'm trying to show the compare at price for some product variants but I
I am trying to create a virtual javascript calendar drop down. I want the
I'm trying to do a very basic date-difference calculation with javascript, but am getting
I am trying to show a list of survey by javascript. Here is the
I'm trying to output a <script> element in an innerHTML: <script type=text/javascript> function fileManager()
Trying to show a label only when a certain item in a combo is
I'm trying to show/hide( or simply put - filter ) my markers( of houses
I'm trying to show a UIAlertView before actually deleting a cell from a UITableView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.