Solved

Altering existing javascript (onKeyup script)

Posted on 2009-07-07
1
265 Views
Last Modified: 2012-05-07
I have an existing javascript code which simply transposes what someone types in a textbox into a <span> area on the page.

At the moment the <span> preview text is in brackets (as shown in the code below).  

Can someone tell me what the correct syntax for the code below so that the brackets are not shown around the outputted text?  (it's a simple question i know!).
function previewer()
{
        var subMenu = document.getElementById('preview');
        var inputtext = document.forms[0].companyname.value;
        subMenu.innerHTML = "(" + inputtext + ")"; 
        
}

Open in new window

0
Comment
Question by:hc1619
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 24800518
function previewer()
{
        var subMenu = document.getElementById('preview');
        var inputtext = document.forms[0].companyname.value;
        subMenu.innerHTML =  inputtext ;
       
}
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question