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

· 10년 전 · 463

<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년 전 조회 485
10년 전 조회 426
10년 전 조회 446
10년 전 조회 446
10년 전 조회 400
10년 전 조회 414
10년 전 조회 620
10년 전 조회 829
10년 전 조회 644
10년 전 조회 440
10년 전 조회 438
10년 전 조회 407
10년 전 조회 421
10년 전 조회 530
10년 전 조회 456
10년 전 조회 370
10년 전 조회 418
10년 전 조회 810
10년 전 조회 1,275
10년 전 조회 836
10년 전 조회 636
10년 전 조회 608
10년 전 조회 468
10년 전 조회 466
10년 전 조회 475
10년 전 조회 444
10년 전 조회 461
10년 전 조회 489
10년 전 조회 620
10년 전 조회 527
10년 전 조회 1,266
10년 전 조회 817
10년 전 조회 538
10년 전 조회 611
10년 전 조회 867
10년 전 조회 590
10년 전 조회 722
10년 전 조회 559
10년 전 조회 675
10년 전 조회 504
10년 전 조회 486
10년 전 조회 479
10년 전 조회 531
10년 전 조회 497
10년 전 조회 546
10년 전 조회 543
10년 전 조회 530
10년 전 조회 685
10년 전 조회 698
10년 전 조회 464
10년 전 조회 766
10년 전 조회 1,121
10년 전 조회 564
10년 전 조회 796
10년 전 조회 804
10년 전 조회 630
10년 전 조회 568
10년 전 조회 553
10년 전 조회 645
10년 전 조회 421
10년 전 조회 451
10년 전 조회 666
10년 전 조회 504
10년 전 조회 454
10년 전 조회 457
10년 전 조회 472
10년 전 조회 465
10년 전 조회 447
10년 전 조회 450
10년 전 조회 479
10년 전 조회 587
10년 전 조회 420
10년 전 조회 443
10년 전 조회 521
10년 전 조회 1,259
10년 전 조회 481
10년 전 조회 470
10년 전 조회 592
10년 전 조회 485
10년 전 조회 658
10년 전 조회 588
10년 전 조회 471
10년 전 조회 474
10년 전 조회 525
10년 전 조회 516
10년 전 조회 411
10년 전 조회 405
10년 전 조회 373
10년 전 조회 414
10년 전 조회 818
10년 전 조회 417
10년 전 조회 535
10년 전 조회 446
10년 전 조회 648
10년 전 조회 465
10년 전 조회 380
10년 전 조회 423
10년 전 조회 449
10년 전 조회 571
10년 전 조회 517
🐛 버그신고