모바일 OS에서 자바스크립트 select() 구현하기 입니다.

· 10년 전 · 369

<textarea id="idText">
Hello Apple!
Hello Android!
</textarea>

<script language="javascript" type="text/javascript">
var Mobile="";
var sUsrAgt=navigator.userAgent;

if((/iPhone/i.test(sUsrAgt)) || (/iPod/i.test(sUsrAgt))) Mobile="IP";
else if((/series60/i.test(sUsrAgt)) || (/symbian/i.test(sUsrAgt))) Mobile="SY";
else if(/iPad/i.test(sUsrAgt)) Mobile="IA";
else if(/android/i.test(sUsrAgt)) Mobile="AN";
else if(/windows ce/i.test(sUsrAgt)) Mobile="WM";
else if(/blackberry/i.test(sUsrAgt)) Mobile="BB";
else if(/palm/i.test(sUsrAgt)) Mobile="PM";
else if(/Kindle/i.test(sUsrAgt)) Mobile="KD";

var oTextArea=document.getElementById("idText");

function selectMobile() {
oTextArea.setSelectionRange(0, 9999);
}

function selectAll()
{
if (Mobile) {
oTextArea.focus();
setTimeout("selectMobile()",1234);
}
else {
oTextArea.select();
}
}

selectAll();

</script>

|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 374
10년 전 조회 320
10년 전 조회 335
10년 전 조회 334
10년 전 조회 297
10년 전 조회 298
10년 전 조회 508
10년 전 조회 728
10년 전 조회 535
10년 전 조회 342
10년 전 조회 337
10년 전 조회 300
10년 전 조회 312
10년 전 조회 423
10년 전 조회 343
10년 전 조회 271
10년 전 조회 314
10년 전 조회 700
10년 전 조회 1,167
10년 전 조회 727
10년 전 조회 524
10년 전 조회 502
10년 전 조회 386
10년 전 조회 361
10년 전 조회 370
10년 전 조회 337
10년 전 조회 361
10년 전 조회 381
10년 전 조회 513
10년 전 조회 420
10년 전 조회 1,148
10년 전 조회 703
10년 전 조회 432
10년 전 조회 501
10년 전 조회 770
10년 전 조회 481
10년 전 조회 609
10년 전 조회 447
10년 전 조회 563
10년 전 조회 394
10년 전 조회 369
10년 전 조회 373
10년 전 조회 433
10년 전 조회 392
10년 전 조회 449
10년 전 조회 443
10년 전 조회 424
10년 전 조회 590
10년 전 조회 601
10년 전 조회 370
10년 전 조회 666
10년 전 조회 1,016
10년 전 조회 473
10년 전 조회 696
10년 전 조회 704
10년 전 조회 527
10년 전 조회 479
10년 전 조회 443
10년 전 조회 542
10년 전 조회 316
10년 전 조회 348
10년 전 조회 568
10년 전 조회 404
10년 전 조회 363
10년 전 조회 352
10년 전 조회 371
10년 전 조회 367
10년 전 조회 349
10년 전 조회 356
10년 전 조회 388
10년 전 조회 481
10년 전 조회 320
10년 전 조회 361
10년 전 조회 437
10년 전 조회 1,162
10년 전 조회 373
10년 전 조회 370
10년 전 조회 494
10년 전 조회 373
10년 전 조회 547
10년 전 조회 486
10년 전 조회 371
10년 전 조회 371
10년 전 조회 423
10년 전 조회 420
10년 전 조회 311
10년 전 조회 313
10년 전 조회 267
10년 전 조회 323
10년 전 조회 717
10년 전 조회 336
10년 전 조회 439
10년 전 조회 359
10년 전 조회 555
10년 전 조회 370
10년 전 조회 306
10년 전 조회 334
10년 전 조회 353
10년 전 조회 482
10년 전 조회 431
🐛 버그신고