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

· 10년 전 · 389

<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년 전 조회 410
10년 전 조회 359
10년 전 조회 371
10년 전 조회 369
10년 전 조회 334
10년 전 조회 339
10년 전 조회 546
10년 전 조회 757
10년 전 조회 571
10년 전 조회 375
10년 전 조회 370
10년 전 조회 336
10년 전 조회 348
10년 전 조회 457
10년 전 조회 375
10년 전 조회 300
10년 전 조회 348
10년 전 조회 736
10년 전 조회 1,198
10년 전 조회 761
10년 전 조회 555
10년 전 조회 534
10년 전 조회 411
10년 전 조회 391
10년 전 조회 403
10년 전 조회 370
10년 전 조회 394
10년 전 조회 414
10년 전 조회 544
10년 전 조회 451
10년 전 조회 1,176
10년 전 조회 733
10년 전 조회 459
10년 전 조회 532
10년 전 조회 796
10년 전 조회 511
10년 전 조회 641
10년 전 조회 479
10년 전 조회 591
10년 전 조회 420
10년 전 조회 399
10년 전 조회 401
10년 전 조회 455
10년 전 조회 415
10년 전 조회 474
10년 전 조회 464
10년 전 조회 452
10년 전 조회 611
10년 전 조회 622
10년 전 조회 390
10년 전 조회 683
10년 전 조회 1,036
10년 전 조회 497
10년 전 조회 719
10년 전 조회 718
10년 전 조회 550
10년 전 조회 497
10년 전 조회 462
10년 전 조회 562
10년 전 조회 336
10년 전 조회 371
10년 전 조회 585
10년 전 조회 421
10년 전 조회 383
10년 전 조회 367
10년 전 조회 388
10년 전 조회 391
10년 전 조회 366
10년 전 조회 374
10년 전 조회 405
10년 전 조회 501
10년 전 조회 338
10년 전 조회 374
10년 전 조회 449
10년 전 조회 1,177
10년 전 조회 394
10년 전 조회 380
10년 전 조회 508
10년 전 조회 383
10년 전 조회 562
10년 전 조회 501
10년 전 조회 388
10년 전 조회 379
10년 전 조회 433
10년 전 조회 431
10년 전 조회 322
10년 전 조회 326
10년 전 조회 280
10년 전 조회 333
10년 전 조회 731
10년 전 조회 345
10년 전 조회 447
10년 전 조회 369
10년 전 조회 569
10년 전 조회 379
10년 전 조회 313
10년 전 조회 342
10년 전 조회 366
10년 전 조회 490
10년 전 조회 439
🐛 버그신고