jquery, onclick event keep value

we have simple asp.net/c# with html5 in the front.
<li><a href="">Glee is awesome 1</a></li> will be loop from database.
My question is e.g.<a href="">Glee is awesome 1</a> is clicked,
how can I drop the value into "ShowMeWhatYouSelected"?

so when <a href="">Glee is awesome 1</a> is clicked, the textbox value should be Glee is awesome 1 and etc.
and I do not want to make the page refresh.
Now if i click <a> firstName text box value is gone.

*** I don't have to use <a></a> in  the list. I can change something else if it is easier to solve this issue.

Thanks


<input type="text" id="firstName" value="John">
  <input type="text" id="ShowMeWhatYouSelected">
   <div id="callAgentListDiv"      
    style="
    display:inline-block;
    position: fixed;
    top: 0px;
    bottom: 0;
    left: 0;
    right: 0;
    width: 1090px;
    height: 600px;
    margin: auto;
    z-index:100;
    background-color: #f3f3f3;display:none;">
    <ul id="limheight">
         <li><a href="">Glee is awesome 1</a></li>
         <li><a href="">Glee is awesome 2</a></li>
         <li><a href="">Glee is awesome 3</a></li>
         <li><a href="">Glee is awesome 4</a></li>    
         <li><a href="">Glee is awesome 5</a></li>
         <li><a href="">Glee is awesome 6</a></li>
         <li><a href="">Glee is awesome 7</a></li>
         <li><a href="">Glee is awesome 8</a></li>
         <li><a href="">Glee is awesome 9</a></li>
         <li><a href="">Glee is awesome 10</a></li>
         <li><a href="">Glee is awesome 11</a></li>
         <li><a href="">Glee is awesome 12</a></li>    
         <li><a href="">Glee is awesome 13</a></li>
         <li><a href="">Glee is awesome 14</a></li>
         <li><a href="">Glee is awesome 15</a></li>
         <li><a href="">Glee is awesome 16</a></li>
         <li><a href="">Glee is awesome 17</a></li>    
         <li><a href="">Glee is awesome 18</a></li>
         <li><a href="">Glee is awesome 19</a></li>
         <li><a href="">Glee is awesome 20</a></li>
     </ul>
</div>           
<style>
    #limheight {
    height: 300px; /*your fixed height*/
    -webkit-column-count: 8;
       -moz-column-count: 8;
            column-count: 8; /*3 in those rules is just placeholder -- can be anything*/
}
#limheight li {
    display: inline-block; /*necessary*/
}
</style>   

Open in new window

LVL 1
ITsolutionWizardAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
Test page : https://jsfiddle.net/so23dmwf/

jQuery(function($) {
	$("#limheight li a").on("click", function(evt) {
  	evt.preventDefault();
  	var ShowMeWhatYouSelected = $(this).text();
    $("#ShowMeWhatYouSelected").val(ShowMeWhatYouSelected);
  });
});

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.