<select>
<option value="">--Выберите шрифт--</option>
<option value="Verdana">Verdana</option>
<option value="Times New Roman">Times New Roman</option>
<option value="Courier">Courier</option>
<option value="Arial">Arial</option>
<option value="Tahoma">Tahoma</option>
<option value="Georgia">Georgia</option>
<option value="Comic Sans MS">Comic Sans MS</option>
</select>
<select>
<option value="10px">-10px-</option>
<option value="12px">-12px-</option>
<option value="14px">-14px-</option>
<option value="16px">-16px-</option>
<option value="18px">-18px-</option>
<option value="20px">-20px-</option>
<option value="24px">-24px-</option>
<option value="28px">-28px-</option>
<option value="32px">-32px-</option>
<option value="36px">-36px-</option>
<option value="40px">-40px-</option>
<option value="48px">-48px-</option>
<option value="54px">-54px-</option>
</select>
<div id="div">
<div id="txt1" class="text">Текст</div>
<div id="txt2" class="text">Текст</div>
<div id="txt3" class="text">Текст</div>
<div id="txt4" class="text">Текст</div>
<div id="txt5" class="text">Текст</div>
<div id="txt6" class="text">Текст</div>
<div id="txt7" class="text">Текст</div>
<div id="txt8" class="text">Текст</div>
<div id="txt9" class="text">Текст</div>
<div id="txt10" class="text">Текст</div>
</div>
<script>
window.onload = function () {
var elems = document.body.children;
var div = elems[2];
elems[0].onchange = function () {
var elem = document.getSelection().anchorNode.parentNode;
if (elem.parentNode.id == 'div') {
elem.style.fontFamily = this.value;
}
}
elems[1].onchange = function () {
var elem = document.getSelection().anchorNode.parentNode;
if (elem.parentNode.id == 'div') {
elem.style.fontSize = this.value;
}
}
}
</script>