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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:01:55+00:00 2026-06-08T18:01:55+00:00

In a case of HTML I use document.getElementById(id); in order to retrieve my desired

  • 0

In a case of HTML I use document.getElementById("id"); in order to retrieve my desired element/tag.

How can I do that in case of a JSP file (let’s say inside a function)?

  • 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-08T18:01:58+00:00Added an answer on June 8, 2026 at 6:01 pm

    I think you are confusing the terms HTML, JSP and JavaScript. The document.getElementById("id") you mention in your question is a JavaScript snippet that, I guess is enclosed in a <script type="text/javascript"></script> tag (which is an HTML tag by the way).

    HTML is a markup language used to define how web pages looks like (well, actually is CSS the one in charge of the look & feel whilst HTML defines the page layout).

    JavaScript is an interpreted language often embedded into the HTML and executed by your browser once the contents of the page are loaded.

    JSP is another markup language based on HTML with several enhancements which allows to create dynamic web pages. JSP is executed by the server instead of the browser and the result of that execution is a HTML document. That generated HTML will contain references to CSS and JavaScript resources if the original JSP had. Even more, the JSP could use its ability to generate “dynamic content” to also generate “dynamic JavaScript snippets”.

    So, the answer is: You can use JavaScript snippets in JSP just the same way you do in HTML code but you can’t use it inside Java methods embedded in the JSP as they are processed by the server, not the browser.

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

Sidebar

Related Questions

I have a block of HTML that I would like to use as the
I have a script which loads content into a iframe using: document.GetElementById('iframeid').src = 'site.html';
I send the variable newUser from options.html to background.html with chrome.extension.getBackgroundPage() like this document.getElementById(save).addEventListener(
Html text box should have same font size for both upper and lower case
In my case, I have an HTML/CSS Menu in the site master . So,
I've got the following html: <ul id=clients-strip> <li> <a href=http://example.com/case-studies/ data-colour=/images/made/assets/images/article-images/client-colour.png> <img src=/images/made/assets/images/article-images/client-grayscale.png alt=Client
I have this print statement: print <a href='#' onClick='document.getElementById(\myheader\).innerHTML=\\'.$rowQuery['keyword'].&nbsp; ·&nbsp;</a>; Unfortunately, it prints: <a
I'm trying to use jFontSize in a local html page to be displayed in
var canvas = document.getElementById('drawhere'); function Player(x,y,w,h){ this.speed = 2; this.x = x; this.y =
I'm trying to implement the following code in a html document: $(function () {

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.