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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:45:43+00:00 2026-05-24T03:45:43+00:00

I have this HTML tag: <span id=pricea runat=server>13323223</span> and I am changing this value

  • 0

I have this HTML tag:

<span id="pricea" runat="server">13323223</span> and I am changing this value with JavaScript:

<script type="text/javascript">
$(function () {
    $("#pricea").hover(function () {
        document.getElementById("pricea").innerHTML = "1234"
      });
 });
</script>

Now,when I do postback after clicking asp:Button, the span value returns to be the original value and I can’t take the new value that was changed by the JavaScript.

I thought maybe use request.form(“pricea”), but it seem to be working only for input fields, so my question is:

how can I get the value of this span (after it was change by the JavaScript) in server side?

thanks for any help

  • 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-24T03:45:44+00:00Added an answer on May 24, 2026 at 3:45 am

    The HTML document is not posted back to the server, only the content in the fields in the form.

    If you want to send the value back to the server, you have to put it in a form field. You can add a hidden field to the form where you can keep a copy of the content of the span:

    <asp:Hidden name="pricea_copy" id="pricea_copy" />
    

    Now when you change the span, you also change the hidden field:

    document.getElementById("pricea").innerHTML = "1234";
    document.getElementById("pricea_copy").value = "1234";
    

    After the postback, you can access the changed value in the hidden field using pricea_copy.Value, and use that to set the content of the span tag for the new page.

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

Sidebar

Related Questions

I have this so far... <script type=text/javascript> $(document).ready(function () { $('ul').addClass('navMenu'); $('li').addClass('todo').html(<span class='navItemHead'></span>); $('span.navItemHead').wrap(<a
I have this HTML code for radios: <input type='radio' name='a_27' value='Yes' id='a_27_0' /> <input
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
i have this html <ul> <li><form action=# name=formName></li> <li><input type=text name=someName /></li> <li><input type=text
I have a span tag in html and this <span> can appear multiple times
If I have html like this: <li id=listItem> This is some text <span id=firstSpan>First
I have this text file filled with some html code; <span>test</span><p>welcome</p> <span>Guest</span><p><img class=insertedImage src=/dynamictemplate/uploads/temp/167-5-IMG_0755.JPG
I have this code which can display drop down in div tag of html.
I have a simple html multiline tooltip implementation: this.tooltip = function(tag) { xOffset =
I have this html... <select id=View name=View> <option value=1>With issue covers</option> <option value=0>No issue

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.