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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:41:33+00:00 2026-05-28T16:41:33+00:00

var example = Test ; $(‘button’).click(function() { $(‘div’).append(example); }); <button>Whatever</button> <div></div> How can I

  • 0
var example = "Test" ;

$('button').click(function() {
 $('div').append(example);
});

<button>Whatever</button>
<div></div>

How can I add text after the variable example in the jQuery code?

In other words, in the jQuery code how can I add text (in this example: “blah”) after the variable so the HTML code will appear like this

<div>Testblah</div>
  • 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-28T16:41:34+00:00Added an answer on May 28, 2026 at 4:41 pm

    Not sure if this is what you are looking for,

    $('div').html(example + "blah");
    

    Note I have used .html instead of .append. You can also use .text if you gonna insert plain text inside the div.

    Above is just a plain javascript string concatenation. You should read about String Operators

    Also the above doesn’t change the value of var example. If you want the value to be changed then assign the result to the example and set the div html.

     example += 'blah';
     $('div').html(example);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really confused here, can someone explain this to me? request: http://example.com/test.php?var=String's $a =
I have a simple javascript problem. Here is an example: function Test(Var) { ...
I use a query string, for example test.php?var=1 . How can I check if
Example: var test = 'global value'; (function() { var test = 'local value'; //
var exampleURL = '/example/url/345234/test/'; var numbersOnly = [?] The /url/ and /test portions of
Example: var arr_1:Array = new Array(); arr_1.push({sdate:2010-02-02,status:New}); arr_1.push({sdate:2010-02-03,status:New}); arr_1.push({sdate:2010-02-04,status:New}); arr_1.push({sdate:2010-02-05,status:New}); How can i change
For example: (function() { var proxied = window.eval; window.eval = function() { return proxied.apply(this,
In the following example Test that v1 function was called fails. Is there a
I have a url in javascript, set as a variable. Like: var imageurl='example.com/test/real/image.jpg'; I
I want to get the location and the first folder, like: http://www.example.com/test/ var $location

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.