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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:51:34+00:00 2026-05-31T02:51:34+00:00

I have this code if(!document.getElementById(‘slider_cmp’)) { var toolTip = document.createElement(div); toolTip.className = cmp_tips; toolTip.id

  • 0

I have this code

if(!document.getElementById('slider_cmp'))
{
    var toolTip = document.createElement("div");
    toolTip.className = "cmp_tips";
    toolTip.id = "cmp_tips";
    toolTip.style.position = "absolute";
    toolTip.style.top =  '145px';
    toolTip.style.left = '50px';
    toolTip.style.display = "none";
    toolTip.style.zIndex = 9999;        
    toolTip.innerHTML = "I NEED TEXT HERE";
    document.body.appendChild(toolTip);
    var sliderDiv = document.createElement("div");
    sliderDiv.className = "slide-out-div";
    sliderDiv.id = "slider_cmp";
    sliderDiv.style.display = "none";
    var handler = '<div id="clickme"></div><div id="slidecontent"></div>';
    sliderDiv.innerHTML= handler;
    document.body.appendChild(sliderDiv);       
    if(cmpLastCat > 0)
    {

I need to put a <?php echo something ?> instead of "I NEED TEXT HERE" in this code… can somebody please help me?

Thank you.

  • 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-31T02:51:35+00:00Added an answer on May 31, 2026 at 2:51 am

    If the JavaScript is within in a PHP-file, you could simply do:

    toolTip.innerHTML = "<?php echo $someVariableToPrint; ?>";
    

    The PHP-snippet will be evaluated on the server prior to sending the page to client, so what the client recieves is:

    toolTip.innerHTML = "The text in the variable";
    

    Update

    Based on the additional info given in your comment, your code would be:

    toolTip.innerHTML = "<?php echo CBTxt::_('text here'); ?>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code like this: var content = document.getElementById('myDivId'); function MyFunction() { alert(content.style.height);
I have this code: var fullpath = $(this)[0].src; var a = document.createElement('a'); a.href =
I have this code: $('#whatever .item').each(function() { var canvas = document.getElementById('whatever'); var ctx =
I have this code on javascript side: function changeSelectionStyle(id) { if(document.getElementById(id).className != 'yes'){ document.getElementById(id).className
I am using canvas,and I have this code - var myCanvas = document.getElementById(myCanvas), ctx
i have this code for get data from textfield: <script type=text/javascript> var mod=document.getElementById(mod).value; ajax(mod);
I have this code: var max1box = document.getElementById('length'), max2box = document.getElementById('width'), max1 = 100,
I have this code: document.getElementById('root').style.left = '<?php echo $page_position[$info[os]][$info[browser]][0]; ?>'; document.getElementById('root').style.top = '<?php echo
I have this code in JavaScript: function change() { document.getElementById(mem).className = 'gif'; } The
I have this ajax jquery code: var form = document.getElementById('frm'); var data_string = form.serialize();

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.