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

· 10년 전 · 425

<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년 전 조회 447
10년 전 조회 405
10년 전 조회 416
10년 전 조회 413
10년 전 조회 382
10년 전 조회 380
10년 전 조회 594
10년 전 조회 801
10년 전 조회 611
10년 전 조회 411
10년 전 조회 402
10년 전 조회 382
10년 전 조회 385
10년 전 조회 503
10년 전 조회 419
10년 전 조회 340
10년 전 조회 388
10년 전 조회 780
10년 전 조회 1,239
10년 전 조회 810
10년 전 조회 597
10년 전 조회 574
10년 전 조회 441
10년 전 조회 430
10년 전 조회 444
10년 전 조회 408
10년 전 조회 432
10년 전 조회 459
10년 전 조회 590
10년 전 조회 494
10년 전 조회 1,220
10년 전 조회 773
10년 전 조회 495
10년 전 조회 580
10년 전 조회 832
10년 전 조회 552
10년 전 조회 688
10년 전 조회 530
10년 전 조회 634
10년 전 조회 467
10년 전 조회 444
10년 전 조회 442
10년 전 조회 495
10년 전 조회 463
10년 전 조회 508
10년 전 조회 513
10년 전 조회 495
10년 전 조회 654
10년 전 조회 666
10년 전 조회 426
10년 전 조회 727
10년 전 조회 1,076
10년 전 조회 532
10년 전 조회 760
10년 전 조회 764
10년 전 조회 592
10년 전 조회 534
10년 전 조회 508
10년 전 조회 604
10년 전 조회 375
10년 전 조회 414
10년 전 조회 628
10년 전 조회 467
10년 전 조회 426
10년 전 조회 418
10년 전 조회 425
10년 전 조회 429
10년 전 조회 403
10년 전 조회 416
10년 전 조회 443
10년 전 조회 544
10년 전 조회 385
10년 전 조회 406
10년 전 조회 483
10년 전 조회 1,226
10년 전 조회 443
10년 전 조회 423
10년 전 조회 553
10년 전 조회 433
10년 전 조회 620
10년 전 조회 544
10년 전 조회 429
10년 전 조회 425
10년 전 조회 478
10년 전 조회 474
10년 전 조회 366
10년 전 조회 372
10년 전 조회 324
10년 전 조회 376
10년 전 조회 776
10년 전 조회 386
10년 전 조회 489
10년 전 조회 409
10년 전 조회 608
10년 전 조회 422
10년 전 조회 347
10년 전 조회 381
10년 전 조회 403
10년 전 조회 522
10년 전 조회 476
🐛 버그신고