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

· 10년 전 · 451

<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년 전 조회 479
10년 전 조회 424
10년 전 조회 440
10년 전 조회 440
10년 전 조회 396
10년 전 조회 409
10년 전 조회 610
10년 전 조회 822
10년 전 조회 638
10년 전 조회 436
10년 전 조회 432
10년 전 조회 401
10년 전 조회 414
10년 전 조회 522
10년 전 조회 446
10년 전 조회 361
10년 전 조회 412
10년 전 조회 805
10년 전 조회 1,265
10년 전 조회 829
10년 전 조회 630
10년 전 조회 600
10년 전 조회 461
10년 전 조회 456
10년 전 조회 470
10년 전 조회 436
10년 전 조회 454
10년 전 조회 480
10년 전 조회 612
10년 전 조회 519
10년 전 조회 1,250
10년 전 조회 803
10년 전 조회 526
10년 전 조회 601
10년 전 조회 855
10년 전 조회 579
10년 전 조회 712
10년 전 조회 551
10년 전 조회 659
10년 전 조회 489
10년 전 조회 475
10년 전 조회 473
10년 전 조회 523
10년 전 조회 481
10년 전 조회 539
10년 전 조회 534
10년 전 조회 520
10년 전 조회 677
10년 전 조회 692
10년 전 조회 451
10년 전 조회 758
10년 전 조회 1,108
10년 전 조회 557
10년 전 조회 786
10년 전 조회 791
10년 전 조회 620
10년 전 조회 558
10년 전 조회 540
10년 전 조회 637
10년 전 조회 409
10년 전 조회 439
10년 전 조회 651
10년 전 조회 496
10년 전 조회 449
10년 전 조회 442
10년 전 조회 462
10년 전 조회 457
10년 전 조회 438
10년 전 조회 440
10년 전 조회 472
10년 전 조회 574
10년 전 조회 414
10년 전 조회 431
10년 전 조회 511
10년 전 조회 1,251
10년 전 조회 475
10년 전 조회 460
10년 전 조회 584
10년 전 조회 473
10년 전 조회 649
10년 전 조회 581
10년 전 조회 459
10년 전 조회 461
10년 전 조회 512
10년 전 조회 507
10년 전 조회 400
10년 전 조회 400
10년 전 조회 364
10년 전 조회 405
10년 전 조회 808
10년 전 조회 408
10년 전 조회 525
10년 전 조회 439
10년 전 조회 639
10년 전 조회 454
10년 전 조회 373
10년 전 조회 410
10년 전 조회 439
10년 전 조회 558
10년 전 조회 508
🐛 버그신고