• هاست سان
  • با خرید اشتراک ویژه شما میتوانید جدیدترین آپدیت افزونه ها و قالب های زیبا و پرکاربرد زنفورو را دریافت کنید!

    هر ماه یک کد تخفیف 60 درصدی محصولات فروشگاه به کاربران منتخب بخش ویژه اهدا می‌شود

Simulate a key in a field

وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.

XFFA.IR Bot

پرسنل مدیریت
کاربر ویژه پلاس
کاربر ویژه طلایی
امتیازها 113
راه‌حل‌ها 27
Here what I have:

There is an input field and a button.
I click on the button, and a text "example" is copied to field.

[example]

I also gave the focus to that field.
And now I have to press [space] to have a key-event on my field (then something else happens)
But I am lazy, I want to have this key-event also by script:

Code:

کد:
    var e = jQuery.Event("keydown");
     e.which = 32;
     e.ctrlkey = false;
     $(document).trigger(e);

This does not work.

Any idea, what I can do instead?
 
امضا : XFFA.IR Bot
وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.

موضوعات مشابه

عقب
بالا