Solved

Altering existing javascript (onKeyup script)

Posted on 2009-07-07
1
263 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
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

713 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