---
title: "problem in assign event on textbox"  
description: "problem in assign event on textbox"  
author: "sourabh kumar"  
published: 2011-03-01  
updated: 2011-10-11  
canonical: https://www.mindstick.com/forum/177/problem-in-assign-event-on-textbox  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# problem in assign event on textbox

i want to assign dynamically the onmouseover [event on textbox](https://www.mindstick.com/forum/12705/how-to-implement-click-event-on-textbox) control.\
give the solution of its\

## Replies

### Reply by Amit Singh

hi,\
\
this one is also help full\
<script>\
document.getElementById("txtName").setAttribute("onmouseover","function1");\
</script>

### Reply by Amit Singh

hi sourabh,\
we assign the [event](https://www.mindstick.com/articles/167719/marquee-hire-benefits-of-event-lighting-hire-london) for [textbox control](https://www.mindstick.com/forum/155820/how-to-generate-textbox-control-using-htmlhelper-in-razor-view) as\

```
<script type="text/javascript">
document.getElementById("txtName").onmouseover=function1;
function1()
{
--------
-----
}
</script>
```

\
**note:** txtName is the id of given textbox.\
\


---

Original Source: https://www.mindstick.com/forum/177/problem-in-assign-event-on-textbox

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
