Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Altering existing javascript (onKeyup script)

Posted on 2009-07-07
1
Medium Priority
?
278 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 2000 total points
ID: 24800518
function previewer()
{
        var subMenu = document.getElementById('preview');
        var inputtext = document.forms[0].companyname.value;
        subMenu.innerHTML =  inputtext ;
       
}
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
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)
Suggested Courses

926 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