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

· 10년 전 · 361

<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년 전 조회 329
10년 전 조회 331
10년 전 조회 292
10년 전 조회 295
10년 전 조회 502
10년 전 조회 724
10년 전 조회 532
10년 전 조회 337
10년 전 조회 335
10년 전 조회 298
10년 전 조회 309
10년 전 조회 419
10년 전 조회 339
10년 전 조회 266
10년 전 조회 310
10년 전 조회 696
10년 전 조회 1,162
10년 전 조회 720
10년 전 조회 517
10년 전 조회 497
10년 전 조회 373
10년 전 조회 352
10년 전 조회 364
10년 전 조회 332
10년 전 조회 355
10년 전 조회 373
10년 전 조회 507
10년 전 조회 411
10년 전 조회 1,144
10년 전 조회 700
10년 전 조회 426
10년 전 조회 495
10년 전 조회 765
10년 전 조회 476
10년 전 조회 602
10년 전 조회 443
10년 전 조회 558
10년 전 조회 386
10년 전 조회 362
10년 전 조회 367
10년 전 조회 425
10년 전 조회 387
10년 전 조회 446
10년 전 조회 436
10년 전 조회 419
10년 전 조회 585
10년 전 조회 592
10년 전 조회 362
10년 전 조회 659
10년 전 조회 1,012
10년 전 조회 465
10년 전 조회 688
10년 전 조회 698
10년 전 조회 519
10년 전 조회 474
10년 전 조회 438
10년 전 조회 535
10년 전 조회 310
10년 전 조회 342
10년 전 조회 560
10년 전 조회 399
10년 전 조회 358
10년 전 조회 347
10년 전 조회 365
10년 전 조회 361
10년 전 조회 344
10년 전 조회 352
10년 전 조회 384
10년 전 조회 475
10년 전 조회 317
10년 전 조회 352
10년 전 조회 430
10년 전 조회 1,158
10년 전 조회 369
10년 전 조회 366
10년 전 조회 490
10년 전 조회 368
10년 전 조회 542
10년 전 조회 479
10년 전 조회 364
10년 전 조회 367
10년 전 조회 418
10년 전 조회 412
10년 전 조회 307
10년 전 조회 309
10년 전 조회 263
10년 전 조회 317
10년 전 조회 715
10년 전 조회 330
10년 전 조회 434
10년 전 조회 351
10년 전 조회 549
10년 전 조회 367
10년 전 조회 301
10년 전 조회 329
10년 전 조회 349
10년 전 조회 479
10년 전 조회 424
🐛 버그신고