Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] Wrap element around highlighted text

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #185732
    Anonymous
    Inactive

    Lets say I highlight text in a page as if I want to copy it, how can I wrap an HTML element around that highlighted text when a button is clicked? example,

    If I highlight the “HTML element” in the above paragraph, than click a button, The HTML will then look like this

    “, how can I wrap an HTML element around”,

    I basically want to wrap any HTML element within the highlighted text after the user clicks a button.

    #185773
    Paulie_D
    Member
    #185801
    Anonymous
    Inactive

    Actually I found something that does what I’m looking for http://ckeditor.com/demo#inline

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.