Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8074465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:39:26+00:00 2026-06-05T14:39:26+00:00

I am using ZeroClipboard to copy code from a generator which can then be

  • 0

I am using ZeroClipboard to copy code from a generator which can then be pasted by the user. I can easily copy the code from the generator to the clipboard, however when I add the .replace command after .innerHTML it also copies the html tags <p> and <span>.
The HTML for the output of the generator is as shown below:

<div id="jj_yourcode_br" class="jj_yourcode">
    <p>border-radius: <span id="jj_radius">10</span>px; </p>
</div>

and the javascript that gets the text from the element and tried to replace the HTML tags with a blank value.

<script type="text/javascript">
    ZeroClipboard.setMoviePath( 'http://joomjunk.co.uk/modules/mod_css3_gen/js/ZeroClipboard.swf' );
    var clip = new ZeroClipboard.Client();

    clip.setText( document.getElementById('jj_yourcode_br').innerHTML.replace(/<\S[^><]*>/g, '' );
    clip.glue( 'd_clip_button' );
</script>

What have I done wrong with the javascript code and how can I fix it so that it eliminates these tags?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:39:28+00:00Added an answer on June 5, 2026 at 2:39 pm

    you are missing a ) there

    clip.setText(document.getElementById('jj_yourcode_br').innerHTML.replace(/<\S[^><]*>/g, '' ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery ui dialog in my page and surprisingly the zeroclipboard copy-to-clipboard
I'm using http://www.steamdev.com/zclip/#usage to copy some text to the clipboard and that code is
I'm working on copy to clipboard using the zeroclipboard api,. I made a simple
I'm using Jquery plugin ZClip or ZeroClipboard which copies content to the clipboard via
I am having trouble copying text using zeroclipboard. This is my html code: <dl
Using jQuery, one can easily find out whether a particular element is visible using
I'm building <div> elements using AJAX, and I want to add ZeroClipboard functionality. Firebug
so I'm trying to use this plugin: http://code.google.com/p/zeroclipboard/wiki/Instructions which basically allows you to set
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
Im trying to copy data to clipboard using zclip jquery. problem that im facing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.