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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:04:53+00:00 2026-05-26T20:04:53+00:00

Using the following code I want to add an icon to the text link

  • 0

Using the following code I want to add an icon to the text link but not to the image link. and I want the image in-line rather than as a background as the usual css background image method doesn’t work for link text that wraps lines.

<a href="foobar.pdf"><img src="http://lorempixel.com/75/100/abstract/1" /></a>
<br />
<a href="foobar.pdf">Title of the PDF (10MB)</a>

I need to do this with jQuery as I manage a large site (over 4 million pages).

Any pointers appreciated.

  • 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-26T20:04:53+00:00Added an answer on May 26, 2026 at 8:04 pm

    Try something like this:

    var non_img_link = $("a:not(:has(img))");
    var icon = $("<img>", {src: "icon.png"});
    
    non_img_link.append(icon);
    // or .prepend() if you prefer
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to remove duplicates in a list using following code, but it does
I know how to add text blocks dynamically using the following code: TextBlock tb
Hi there im using the following code for insert text and images, but I
I've been using the following code in my Web form code-behind classes. I want
I want to write a .xml file using the following code into the App_Data/posts.
I'm using following code but cannot return data from MySQL. This is the output:
I want to send an email with an attachment using the following code (Python
I want to add named data cache programmatically in appfabric. I kept following code
I am using JSF 2.0 I am able to add Background image to the
i am using following code to add values $debdes = $_POST['debdes']; $debamt = $_POST['debamt'];

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.