JQuery Onchange when not changed -


मैं उपयोग कर रहा हूं:

  $ ('# input1')। परिवर्तन (फ़ंक्शन ( ) {$ ('# Input2')। Val ($ (यह) .val ());});   

जब आप कुछ जोड़ते हैं या बदलते हैं, तो उपरोक्त काम ठीक होता है।

मेरा प्रश्न यह है, जब मैं इनपुट 1 का मान प्राप्त करना चाहता हूं और इसे आवंटित करना चाहता हूं Input2 eventhough input1 परिवर्तित नहीं किया गया है?

आपको इसे किसी तरह ट्रिगर करना होगा।

उदाहरण के लिए एक बटन के साथ।

  $ ("myButtonSelector")। क्लिक करें (फ़ंक्शन () {$ ("# input2")। Val ($ ("# input1")। Val ( ));});   

या फ़ोकस पर

  $ ("# input1")। फ़ोकस (फ़ंक्शन () {$ ("# input2")। Val ($ ( यह) .val ());});   

या किसी भी अन्य ईवेंट पर आपको आवश्यकता होगी।

Comments

Popular posts from this blog

php - how to change mysql_result($res, 0, "url"); to mysqli -

Delphi: missing interface declarations for UI Automation methods -

android - How to attach an image from an app to gmail -