Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get text on mouse click

Status
Not open for further replies.

lllyxer

Programmer
Nov 22, 2006
22
US
If i have a string separated by commas, let it be the following

==========Text=============
New York, Paris, London, Boston
========== End=============

When a user clicks on word "Paris", I need to get the word "Paris" out of the string, so it will be look like this

==========Text=============
New York, London, Boston
========== End=============

How this can be done.

Thank you
 
Hi

JavaScript:
function rm(what)
{
  what.parentNode.removeChild(what)
}
HTML:
<span onclick="rm(this)">New York,</span>
<span onclick="rm(this)">Paris,</span>
<span onclick="rm(this)">London,</span>
<span onclick="rm(this)">Boston</span>

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top