ondomready가 열리거나 열리면 내 크롬 확장 팝업의 텍스트 영역에 focus()를 호출 할 수없는 것 같습니다.)크롬 확장 팝업 텍스트 영역 포커스
<html>
<head>
<link rel="stylesheet" href="css/content.css" type="text/css">
<script type="text/javascript" src="js/lib/jquery.js"></script>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<div class="container">
<textarea name="newText"></textarea>
</div>
</body>
CSS의 변화 작품, 포커스 (하지 않습니다 내가 그렇게 popup.html에서 참조
$(document).ready(function() {
console.log($("#moped-text"));
$('textarea').focus();
$('.container').css("color", "red");
});
:
내가 popup.js에서 그런 일이 !
팝업을 디버깅하고 $ ('textarea')를 입력하면. focus(); 콘솔에서 작동합니다. 준비 콜백 내부에 추가 된 이벤트도 성공적으로 바인딩됩니다.
도움이 되었습니까?
나를 위해도 작업이 밤은 : [자동 초점 Google 크롬 확장 프로그램에서 (HTTP를 : // 유래 .com/questions/6594064/auto-focus-in-google-chrome-extension) – hc2p