I am studying some source code of a website and would like to know how to trigger programmatically the ajax autocomplete on this text box. I tried to include just the relevant code.
html:
<div class="input-text xxl-width completer">
<input type="text" placeholder="" id="textBoxText" name="textBoxText" class="predictiveText" autocomplete="off">
<div class="autocompleter-wrapper" style="display: none;">
</div>
</div>
javascript:
var w = this.$scope,
u = i.keyCodes,
v = this,
t = {
$predictiveLookup: w,
$predictiveInput: w.find("input.predictiveText"),
},
t.$predictiveInput.keydown(i.keyExecutor.onAllKeysExcept(function() {
v.isKeyDown = true
}, [u.enter, u.keyUp, u.keyDown, u.escape]));
t.$predictiveInput.keyup(i.keyExecutor.onAllKeysExcept(function() {
v.checkCompletion(n);
v.isKeyDown = false
}, [u.enter, u.keyUp, u.keyDown, u.escape]));
When I call $(elem).keyup(); or $(elem).keydown(); Nothing happens. Is there any way to trigger these events programmatically?