Solved

Altering existing javascript (onKeyup script)

Posted on 2009-07-07
1
260 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now