I have an input it has a function running if the keycode ==13
I also have a button on the same page if the user clicks that button it should trigger click event associated with it and at the same time it should also fire the enter click using javascript
the code is shown as below
<input type="text" class="myInputValue">
<button class="myLink">submit</button>
(function(){
var inputc = document.getElementsByClassName('myInputValue')[0];
var submitbtn = document.getElementsByClassName('myLink')[0]
inputc.addEventListener("keydown", function(e){
if(e.keyCode == 13){
alert("Entered")
}
});
submitbtn.addEventListener("click", function(e){
// here I need functionality which will fire enter key event too
});
})();