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
Solved

Altering existing javascript (onKeyup script)

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
website rewamp 5 42
removing a class in javascript 4 50
Phone Does Not Abide By CSS Breakpoint For Navigation Controls 6 22
CSS DIV Height in Percent 1 8
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

829 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