# Other Languages > jQuery >  [RESOLVED] Adding Events With Dynamic HTML Control

## aNubies

Good day,

I was able to make the adding of html textbox control working perfectly. 

So here's my code for adding textboxes.


```
var elementCounter = 2;

// NEW BOOK TEXTBOX.
var newBookTextbox = $(document.createElement('div'))
     .attr("class", "col-md-2");

newBookTextbox.after().html('<input type="text" id="Book' + requestCounter + '" class="form-control width-skills" name="Book' + requestCounter + '" style="font-size:12px" maxlength="2">');
newBookTextbox.appendTo(multiRequestDiv);

// NEW TITLE TEXTBOX.
var newTitleTextbox = $(document.createElement('div'))
     .attr("class", "col-md-2");

newTitleTextbox.after().html('<input type="text" id="Title' + requestCounter + '" class="form-control width-skills" name="Title' + requestCounter + '" style="font-size:12px">');
newTitleTextbox.appendTo(multiRequestDiv);
```

As you can see I'm creating two textboxes under the name of "Book" and "Title". Now what I want is to append an OnBlur event upon creating of new instance of textbox "Book" only. So everytime they type on "Book(x)" an alert will be prompted.

Can anyone help me about this.. Thank you

----------


## aNubies

I got it  :wave: 



```
// NEW BOOK TEXTBOX.
var NewBookTextbox = document.createElement('input');

NewBookTextbox.id = "Book";
NewBookTextbox.name = "Book";
NewBookTextbox.className = "form-control";
NewBookTextbox.style.cssText = "font-size: 12px";
NewBookTextbox.onblur = function () {
      <!-- Method Here -->
};
```

As you can see I change how I create a dynamic control from using a "$(document.createElement)" to plain, so that I have an access to the function of blur in native way.

----------


## kfcSmitty

If you were able to solve your problem, you should post the code you used to fix it here. That way, if someone is having a similar issue, when they search they don't just find a "I got it" post without a solution.

----------

