Wie kann ich in der Colorbox den Fokus auf ein Input Feld setzen?
Normalerweise geht das ja mit autofocus oder $('#ID').focus()
Beides bleibt ohne Funktion. Wer weiß Rat?
Normalerweise geht das ja mit autofocus oder $('#ID').focus()
Beides bleibt ohne Funktion. Wer weiß Rat?
HTML-Code:
<!DOCTYPE html> <html> <head> <title>test</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../jquery.colorbox-min.js"></script> <link rel="stylesheet" href="colorbox.css" /> <script> $(document).ready(function(){ $('#test').focus(); $(".ajax").colorbox(); }); </script> </head> <body> <p><a class='ajax' href="ajax.php">Ajax</a></p> </body> </html>
HTML-Code:
<div style="height:135px; width:380px; padding:30px 10px;"> <form method="post" action=""> <input type="text" name="test" id="test"> <input type="submit"> </form> </div>
Kommentar