Printer Friendly Javascript Remove Links

Posted on 2012-08-10
Last Modified: 2012-08-10
I have a javascript function for a printer friendly page.  The only problem is that hyperlinks show up in the printer friendly page.  I need the text within the <a> tags without the links.

How do I remove just the <a> tags from document object?  Please, no CSS -- I need to get the javascript below working.

Here's the javascript code:

var html = document.getElementById("spacer").innerHTML;
var winprint ="", "", sOption);

Question by:lcor
    LVL 35

    Accepted Solution

    try this:

    Open in new window


    Author Closing Comment

    It works!  Awesome!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    element on site jumps 4 26
    Problem to Popup 37 60
    html select on change 3 11
    Is there a way to optimise this code? 3 0
    This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now