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 489813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:50:47+00:00 2026-05-13T01:50:47+00:00

If page has .pdf files linked then a message in <p> should be add

  • 0

If page has .pdf files linked then a message in <p> should be add just before end of the #mainontent div as a last paragraph <p>

for example this is default html?

<div id="maincontent">
<ul class="cheat_sheet_downloads">
<li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a></li>
<li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v3.pdf/">PNG, 77Kb</a></li>
</ul>
<div>

After detecting pdf

it should be like this

<div id="maincontent">
    <ul class="cheat_sheet_downloads">
    <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf/">PDF, 316Kb</a></li>
    <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v3.pdf/">PNG, 77Kb</a></li>
    </ul>
<div>

<div id="ttip">
Most computers will open PDF documents automatically, but you may need to 
download <a title="Link to Adobe website - opens in a new window"  
href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">
                 Adobe Reader</a>.
</div>

or as another div after #maincontent div. Is it possible with jquery?

Edit:

Page can have one or more PDF i want to add message at bottom. and i need IE 6 compatibility too

Edit 2 : I can’t and don’t want to use mouse over tooltip

  • 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-05-13T01:50:47+00:00Added an answer on May 13, 2026 at 1:50 am
    var tip = "<p>Most computers will open PDF documents ";
    tip += "automatically, but you may";
    tip += "need to download <a title='Link to Adobe website-opens in a new window'";
    tip +=" href='http://www.adobe.com/products/acrobat/readstep2.html'  
                   target='_blank'>Adobe Reader</a>.</p>";
    
    $(document).ready(function(){
    
        //IF NUMBER OF PDF LINKS IS MORE THAN ZERO INSIDE DIV WITH ID maincontent
        //THEN THIS WILL PUT TIP PARAGRAPH AS LAST CHILD OF DIV
        if($("div#maincontent a[href*='/pdf']").length>0){
        $("div#maincontent").children(":last-child").after(tip);
        }
    });
    

    check it here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My client has a multi-page PDF file. They need it split by page. Does
I'm working on a page has an ol with nested p's, div's, and li's.
I have small page which has label, DropDownList and a submit button. <div> <asp:label
This Wikipedia page has an extensive list of hashing methods As you can see,
I want to disable Javascript once a page has already loaded. Why? Because I
Is there any way I can detect when my page has been set as
I have a page that has an iframe From one of the pages within
Given an HTML page that has a complex table-based layout and many tags that
I have a Page that has a single instance of a UserControl that itself
I have a page which has a rectangular area with text and icons in

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.