kodyWiG

Tag: match

10 gru 2009

Losowe ustawienie wartości combobox select

var f = document.f2;
f.elements[i].options[Math.floor((f.elements[i].length-1)*Math.random())+1].selected=true;
combo elements floor match options random Select selected
25 mar 2009

Odnajdywanie elementów według określonej klasy

var cont = document.getElementById('content').getElementsByTagName('div');
for(i=0;i<cont.length;i++)
if (cont[i].className.match(/^belka/))
  cont[i].style.display = 'none';

Przyklad ukrycia elementów, wykorzystanie match:

<div id="content">
  <div class="belka">odnajdywanie klasa belki</div>
  <div class="belka">odnajdywanie klasa belki</div>
</div>
className display getElementById getElementsByTagName match
Copyright © | kodyWiG Theme
  • JavaScript 219
  • PHP 139
  • CSS 107
  • HTML 75
  • GMap 47
  • Linux 46
  • PostgreSQL 34
  • MySQL 33
  • VBSCRIPT 32
  • jQuery 27
  • Smarty 27
  • Wordpress 27
  • Windows 24
  • SQL 19
  • htaccess 18
  • Perl 17
  • Programy 11
  • System 11
  • SQL Server 10
  • Leaflet 10
  • Rewrite 9
  • HTTP 8
  • VBA 7
  • React 7
  • Intellij IDEA 6
  • Telefony 6
  • WYSIWYG 6
  • XML 6
  • Nodejs 5
  • SVG 4
  • JSON 3
  • Docker 3
  • Rejestr 3
  • Nauka 2
  • Github 1
  • Bez kategorii 1
  • Opera 1
  • Rollup 1