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

  • Home
  • SEARCH
  • 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 7850085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:44:20+00:00 2026-06-02T18:44:20+00:00

I have a html element: <div id=myElement class=someClass onclick=setText(this.innerHtml) runat=server>text</div> I want to be

  • 0

I have a html element:

<div id="myElement" class="someClass" onclick="setText(this.innerHtml)" runat="server">text</div>

I want to be able to change this element on the client side using some jquery like so:

function setText(text) {            
    $(".someClass").text(text);
}

–OR–

function setAttribute(text) {            
    $(".someClass").attr("myAttr",text);
}

Once I do this I want to grab this element’s new text or new attribute and then store the value of either or, server side. I should note that I then postback to the server using a LinkButton. It is at this time that when I look at the element the default text is still present or the new attribute I added is missing.

Can someone explain why the element does not get updated on the server and how I can get it too?

  • 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-02T18:44:22+00:00Added an answer on June 2, 2026 at 6:44 pm

    I believe the problem you are facing is due to the type of html element you are using, a div. If you simply replace the div with an input of type “text”, it will work as you expect it, allowing you to read values on postback. Only form elements are sent during form submission/postback.

    An example of this is how web-based WYSIWYG text editors work. You type and edit in a div, but in the background all changes you make are stored in a hidden field. This hidden field is used to post the information back to the server.

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

Sidebar

Related Questions

I have this HTML element: <div id='4-12-2012' class='date'>blah blah blah</div> And I'm binding a
I have this HTML-element: <div class=option default></div> ...and I try to get to it
I have an html element like: <div id=spam[500]> I want to search for this
Say I have this html element <div id=hello class=hello option john>Hello</div> <div id=hello class=hello
I have a HTML DIV element: <div class=obj height=this is attr 1 rel=this is
I have an html td element with text inside. I want it so you
So, if I have HTML like this: <div id='div'> <a>Link</a> <span>text</span> </div> How can
i have the html as follows <div class=element-container id=div_3> <div id=submit_submit class=element> <div class=fleft>
I have an HTML element with only visible text inside. This example is a
For example I have this HTML: <body> <div>Text</div> </body> And I would like to

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.