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

· 10년 전 · 358

<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년 전 조회 369
10년 전 조회 314
10년 전 조회 329
10년 전 조회 328
10년 전 조회 288
10년 전 조회 291
10년 전 조회 499
10년 전 조회 722
10년 전 조회 530
10년 전 조회 334
10년 전 조회 332
10년 전 조회 295
10년 전 조회 308
10년 전 조회 416
10년 전 조회 336
10년 전 조회 262
10년 전 조회 307
10년 전 조회 692
10년 전 조회 1,160
10년 전 조회 717
10년 전 조회 511
10년 전 조회 494
10년 전 조회 368
10년 전 조회 350
10년 전 조회 361
10년 전 조회 328
10년 전 조회 348
10년 전 조회 368
10년 전 조회 499
10년 전 조회 406
10년 전 조회 1,137
10년 전 조회 696
10년 전 조회 424
10년 전 조회 491
10년 전 조회 763
10년 전 조회 471
10년 전 조회 595
10년 전 조회 438
10년 전 조회 557
10년 전 조회 384
10년 전 조회 360
10년 전 조회 364
10년 전 조회 418
10년 전 조회 381
10년 전 조회 443
10년 전 조회 432
10년 전 조회 414
10년 전 조회 582
10년 전 조회 589
10년 전 조회 359
10년 전 조회 656
10년 전 조회 1,010
10년 전 조회 463
10년 전 조회 683
10년 전 조회 693
10년 전 조회 516
10년 전 조회 469
10년 전 조회 435
10년 전 조회 529
10년 전 조회 304
10년 전 조회 338
10년 전 조회 556
10년 전 조회 391
10년 전 조회 356
10년 전 조회 343
10년 전 조회 358
10년 전 조회 358
10년 전 조회 340
10년 전 조회 346
10년 전 조회 381
10년 전 조회 472
10년 전 조회 309
10년 전 조회 348
10년 전 조회 426
10년 전 조회 1,154
10년 전 조회 365
10년 전 조회 361
10년 전 조회 488
10년 전 조회 364
10년 전 조회 539
10년 전 조회 474
10년 전 조회 361
10년 전 조회 361
10년 전 조회 414
10년 전 조회 409
10년 전 조회 300
10년 전 조회 306
10년 전 조회 257
10년 전 조회 312
10년 전 조회 710
10년 전 조회 330
10년 전 조회 427
10년 전 조회 348
10년 전 조회 546
10년 전 조회 362
10년 전 조회 299
10년 전 조회 323
10년 전 조회 345
10년 전 조회 472
10년 전 조회 416
🐛 버그신고