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

· 10년 전 · 376

<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년 전 조회 392
10년 전 조회 345
10년 전 조회 355
10년 전 조회 352
10년 전 조회 315
10년 전 조회 321
10년 전 조회 527
10년 전 조회 744
10년 전 조회 553
10년 전 조회 358
10년 전 조회 350
10년 전 조회 316
10년 전 조회 327
10년 전 조회 439
10년 전 조회 359
10년 전 조회 286
10년 전 조회 332
10년 전 조회 717
10년 전 조회 1,184
10년 전 조회 744
10년 전 조회 538
10년 전 조회 515
10년 전 조회 400
10년 전 조회 374
10년 전 조회 382
10년 전 조회 352
10년 전 조회 378
10년 전 조회 393
10년 전 조회 523
10년 전 조회 433
10년 전 조회 1,163
10년 전 조회 716
10년 전 조회 443
10년 전 조회 517
10년 전 조회 785
10년 전 조회 499
10년 전 조회 624
10년 전 조회 462
10년 전 조회 575
10년 전 조회 404
10년 전 조회 386
10년 전 조회 388
10년 전 조회 444
10년 전 조회 399
10년 전 조회 462
10년 전 조회 452
10년 전 조회 435
10년 전 조회 598
10년 전 조회 609
10년 전 조회 377
10년 전 조회 672
10년 전 조회 1,023
10년 전 조회 483
10년 전 조회 703
10년 전 조회 707
10년 전 조회 534
10년 전 조회 487
10년 전 조회 451
10년 전 조회 547
10년 전 조회 325
10년 전 조회 354
10년 전 조회 574
10년 전 조회 412
10년 전 조회 374
10년 전 조회 357
10년 전 조회 379
10년 전 조회 378
10년 전 조회 357
10년 전 조회 366
10년 전 조회 396
10년 전 조회 487
10년 전 조회 327
10년 전 조회 366
10년 전 조회 441
10년 전 조회 1,168
10년 전 조회 378
10년 전 조회 373
10년 전 조회 499
10년 전 조회 375
10년 전 조회 551
10년 전 조회 491
10년 전 조회 377
10년 전 조회 372
10년 전 조회 425
10년 전 조회 424
10년 전 조회 312
10년 전 조회 317
10년 전 조회 271
10년 전 조회 324
10년 전 조회 722
10년 전 조회 340
10년 전 조회 443
10년 전 조회 363
10년 전 조회 560
10년 전 조회 372
10년 전 조회 310
10년 전 조회 338
10년 전 조회 358
10년 전 조회 485
10년 전 조회 436
🐛 버그신고