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

· 10년 전 · 363

<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년 전 조회 371
10년 전 조회 316
10년 전 조회 330
10년 전 조회 331
10년 전 조회 292
10년 전 조회 296
10년 전 조회 502
10년 전 조회 724
10년 전 조회 533
10년 전 조회 337
10년 전 조회 335
10년 전 조회 298
10년 전 조회 309
10년 전 조회 420
10년 전 조회 340
10년 전 조회 266
10년 전 조회 311
10년 전 조회 696
10년 전 조회 1,162
10년 전 조회 721
10년 전 조회 519
10년 전 조회 497
10년 전 조회 374
10년 전 조회 353
10년 전 조회 364
10년 전 조회 332
10년 전 조회 355
10년 전 조회 375
10년 전 조회 508
10년 전 조회 412
10년 전 조회 1,145
10년 전 조회 701
10년 전 조회 429
10년 전 조회 495
10년 전 조회 765
10년 전 조회 477
10년 전 조회 603
10년 전 조회 443
10년 전 조회 558
10년 전 조회 386
10년 전 조회 363
10년 전 조회 368
10년 전 조회 427
10년 전 조회 387
10년 전 조회 446
10년 전 조회 436
10년 전 조회 420
10년 전 조회 585
10년 전 조회 592
10년 전 조회 364
10년 전 조회 659
10년 전 조회 1,013
10년 전 조회 466
10년 전 조회 689
10년 전 조회 698
10년 전 조회 521
10년 전 조회 474
10년 전 조회 439
10년 전 조회 536
10년 전 조회 311
10년 전 조회 342
10년 전 조회 561
10년 전 조회 400
10년 전 조회 359
10년 전 조회 347
10년 전 조회 367
10년 전 조회 361
10년 전 조회 345
10년 전 조회 352
10년 전 조회 384
10년 전 조회 475
10년 전 조회 317
10년 전 조회 353
10년 전 조회 430
10년 전 조회 1,159
10년 전 조회 369
10년 전 조회 366
10년 전 조회 491
10년 전 조회 369
10년 전 조회 543
10년 전 조회 480
10년 전 조회 365
10년 전 조회 367
10년 전 조회 419
10년 전 조회 412
10년 전 조회 307
10년 전 조회 309
10년 전 조회 263
10년 전 조회 319
10년 전 조회 715
10년 전 조회 330
10년 전 조회 435
10년 전 조회 353
10년 전 조회 550
10년 전 조회 367
10년 전 조회 302
10년 전 조회 329
10년 전 조회 350
10년 전 조회 480
10년 전 조회 427
🐛 버그신고