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

· 10년 전 · 416

<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년 전 조회 440
10년 전 조회 400
10년 전 조회 408
10년 전 조회 405
10년 전 조회 373
10년 전 조회 372
10년 전 조회 587
10년 전 조회 792
10년 전 조회 603
10년 전 조회 404
10년 전 조회 395
10년 전 조회 374
10년 전 조회 376
10년 전 조회 496
10년 전 조회 412
10년 전 조회 329
10년 전 조회 379
10년 전 조회 769
10년 전 조회 1,227
10년 전 조회 802
10년 전 조회 585
10년 전 조회 565
10년 전 조회 433
10년 전 조회 422
10년 전 조회 435
10년 전 조회 399
10년 전 조회 425
10년 전 조회 446
10년 전 조회 579
10년 전 조회 484
10년 전 조회 1,214
10년 전 조회 769
10년 전 조회 488
10년 전 조회 570
10년 전 조회 823
10년 전 조회 545
10년 전 조회 678
10년 전 조회 518
10년 전 조회 626
10년 전 조회 456
10년 전 조회 433
10년 전 조회 433
10년 전 조회 487
10년 전 조회 454
10년 전 조회 502
10년 전 조회 500
10년 전 조회 483
10년 전 조회 643
10년 전 조회 656
10년 전 조회 417
10년 전 조회 719
10년 전 조회 1,067
10년 전 조회 520
10년 전 조회 748
10년 전 조회 756
10년 전 조회 580
10년 전 조회 528
10년 전 조회 498
10년 전 조회 596
10년 전 조회 368
10년 전 조회 406
10년 전 조회 620
10년 전 조회 459
10년 전 조회 417
10년 전 조회 407
10년 전 조회 419
10년 전 조회 420
10년 전 조회 394
10년 전 조회 411
10년 전 조회 438
10년 전 조회 534
10년 전 조회 376
10년 전 조회 401
10년 전 조회 474
10년 전 조회 1,217
10년 전 조회 431
10년 전 조회 416
10년 전 조회 545
10년 전 조회 426
10년 전 조회 611
10년 전 조회 534
10년 전 조회 420
10년 전 조회 417
10년 전 조회 471
10년 전 조회 464
10년 전 조회 358
10년 전 조회 362
10년 전 조회 317
10년 전 조회 366
10년 전 조회 768
10년 전 조회 379
10년 전 조회 485
10년 전 조회 400
10년 전 조회 599
10년 전 조회 412
10년 전 조회 343
10년 전 조회 372
10년 전 조회 394
10년 전 조회 516
10년 전 조회 467
🐛 버그신고