0

I have a dynamic web page that after clicking a link, I insert a partial view into my page using brailjs action. My brailjs view looks like this

page.inserthtml('bottom', 'items', { @partial: 'item/_fields_replacement_part' })
page.replacehtml('add_item_link', { @partial: 'item/_addlink_replacement_part' })

After I insert the html, I want to be able set focus to one of the textboxes that was just inserted. How can I do that?

1 Answer 1

1

Say you have this js function:

function setFocus(id) {
   document.getElementById(id).focus();
}

You can call it from brailjs like this:

page.call('setFocus', 'myElementId');
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.