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

· 10년 전 · 420

<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년 전 조회 446
10년 전 조회 401
10년 전 조회 410
10년 전 조회 408
10년 전 조회 377
10년 전 조회 378
10년 전 조회 591
10년 전 조회 797
10년 전 조회 607
10년 전 조회 407
10년 전 조회 398
10년 전 조회 377
10년 전 조회 381
10년 전 조회 498
10년 전 조회 418
10년 전 조회 334
10년 전 조회 382
10년 전 조회 775
10년 전 조회 1,236
10년 전 조회 806
10년 전 조회 594
10년 전 조회 568
10년 전 조회 436
10년 전 조회 425
10년 전 조회 439
10년 전 조회 402
10년 전 조회 428
10년 전 조회 451
10년 전 조회 584
10년 전 조회 488
10년 전 조회 1,219
10년 전 조회 772
10년 전 조회 491
10년 전 조회 575
10년 전 조회 829
10년 전 조회 550
10년 전 조회 682
10년 전 조회 522
10년 전 조회 629
10년 전 조회 460
10년 전 조회 435
10년 전 조회 437
10년 전 조회 490
10년 전 조회 459
10년 전 조회 503
10년 전 조회 506
10년 전 조회 488
10년 전 조회 648
10년 전 조회 659
10년 전 조회 421
10년 전 조회 722
10년 전 조회 1,072
10년 전 조회 527
10년 전 조회 754
10년 전 조회 763
10년 전 조회 587
10년 전 조회 533
10년 전 조회 503
10년 전 조회 601
10년 전 조회 372
10년 전 조회 413
10년 전 조회 626
10년 전 조회 462
10년 전 조회 424
10년 전 조회 415
10년 전 조회 421
10년 전 조회 424
10년 전 조회 400
10년 전 조회 413
10년 전 조회 441
10년 전 조회 538
10년 전 조회 379
10년 전 조회 403
10년 전 조회 478
10년 전 조회 1,221
10년 전 조회 437
10년 전 조회 421
10년 전 조회 549
10년 전 조회 430
10년 전 조회 616
10년 전 조회 540
10년 전 조회 424
10년 전 조회 422
10년 전 조회 474
10년 전 조회 469
10년 전 조회 362
10년 전 조회 368
10년 전 조회 319
10년 전 조회 371
10년 전 조회 770
10년 전 조회 385
10년 전 조회 488
10년 전 조회 405
10년 전 조회 603
10년 전 조회 418
10년 전 조회 345
10년 전 조회 378
10년 전 조회 398
10년 전 조회 520
10년 전 조회 473
🐛 버그신고