Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var AC = JSL('#add_comment');
- function handleChange(event) {
- var area = AC.find('textarea.comment_form');
- // add the selected value onto the textarea's value
- area.prop('value', area.prop('value') + this.options[this.selectedIndex].value);
- }
- // add our <select> tag
- AC.prepend(
- JSL.create('select', {onchange : handleChange}, [
- JSL.create('option', {}),
- JSL.create('optgroup', {label : 'Header One'}, [
- JSL.create('option', {value : 'one', textContent : 'Option One'}),
- JSL.create('option', {value : 'two', textContent : 'Option Two'})
- ]),
- JSL.create('optgroup', {label : 'Header Two'}, [
- JSL.create('option', {value : 'three', textContent : 'Option Three'}),
- JSL.create('option', {value : 'four', textContent : 'Option Four'})
- ])
- ])
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement