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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:35:10+00:00 2026-06-09T08:35:10+00:00

I like add text and some images to a div using jquery. I can

  • 0

I like add text and some images to a div using jquery.

I can do this to add text:

<script type="text/javascript">
$(document).ready(function () { 

$("#help").text('This is the description').css({"border": "1px solid", "color": "Black", "font-size": "14px", "font-weight": "bold", "padding": "30px 0 30px 0", "width": "auto", "height": "auto", "text-align": "left", "background": "lightyellow"});

I tried this:

$("#help").append('<img src="description.png" alt="box_plot_description" />'); 

});

How would append image to this text using jquery?

I have added the append after text but, append is overwriting the div. I like have text at the beginning of the div and after that an image.

  • 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-09T08:35:11+00:00Added an answer on June 9, 2026 at 8:35 am

    use html() method

    $("#help").html('<img src="somesrc.jpg" alt="someimage" />');
    

    Working sample : http://jsfiddle.net/HdFqr/3/

    If you want to keep the existing content and append the image, use append method

    $("#help").text("Some Text");
    $("#help").append('<img src="somesrc.jpg" alt="someimage" />');
    

    Sample : http://jsfiddle.net/HdFqr/4/

    You can also use appendTo method as well

    var img=$("<img />").attr("src","someimag.jpg");
    img.appendTo($("#help"));
    

    Sample : http://jsfiddle.net/HdFqr/6/

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

Sidebar

Related Questions

I use this simple script : <body> <script type=text/javascript> function mouseOver() { document.getElementById(img1).src =images/p2.jpg;
My first script provides to random image as you can see below <script type=text/javascript
I'd like to add some TeX text to my Qt form, like label -
I'd like to add a link to the end of some text that is
I recently started using Masterpages, the thing is I would like to add text
I'm using this slider: http://tutorialzine.com/2009/11/beautiful-apple-gallery-slideshow/ and just want to add some text to each
I've got a gtk.TextView that I'd like to add markup-like text to. I know
I use ListBox for inserting text like You add Michael in your database ,
When the user presses the text Add, then I'd like to create a new
If I add a full text index in PostgreSQL, will my LIKE and ILIKE

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.