I have this code with alert:
input1=function() {
alert('Hello!');
};
$(function() {
$('#drop1').click(input1)
});
and this code with setTimeout:
$(function() {
setTimeout(function() {
$('#drop1').click();
});
});
Both work. But I wanted to leave the second code (setTimeout) with the structure of the first, that of alert. Something like:
input2=function() {
setTimeout()
};
$(function() {
$('#drop1').click(input2)
});
HTML code:
<p id='drop1' style='color:#008cba; background-color:#fffF00;'>
Hi, my name is text 1.
</p>