I have a function where if the user clicks on a button, it will display a value in the textbox and it will perform a trigger to another function after a \'#btn\' button is click
Use data instead of attr - attr takes a string, data takes JavaScript objects.
attr
data