2010-08-24 8 views

cevap

5
$('#my_element_id').focus(); 

. Bunun yerine, select() ekleyin:

$('my_element_id').focus().select(); 
+1

Ama bu giriş alanın içeriğini seçmez:

JQuery içinde

, bu davranış üç fonksiyonları ile çoğaltılmış olabilir? – acme

2
$('my_element_id').focus(); 
1

jQuerys focus() yöntem için bir kısayol

4

Prototype'ın etkinleştirme() işlevi odaklanır ve form elemanları tüm içeriğini seçer. öyle,

// Focus 
$('my_element_id').focus(); 

// Focus and select the content. 
$('my_element_id').focus().select(); 

// Focus and select the content without problems in Google chrome 
$('my_element_id').focus().select().mouseup(function(event){ 
    event.preventDefault(); 
}); 
İlgili konular