All pastes #393280 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-13 12:44 UTC
rendered paste body
<script>
// same as document ready, but shorter
$(function() {
	
	$('#add_attribute').click( function() {

		// where does attributes come from?	
		var str = '<label style="color: #000000;font-size: 10px;font-weight: bold;">Name: </label><input type="text" name="attr_name[' + attributes + ']" size="15" value="" />&nbsp;';
		str += '<label style="color: #000000;font-size: 10px;font-weight: bold;">Value: </label><input type="text" name="attr_value[' + attributes + ']" size="25" value="" /> <a href="#" class="kill_attribute" style="font-weight: bold;text-decoration: none;padding-left: 3px;padding-right: 3px; border: 1px solid white;background-color: red;color: white;" ref="' + attributes + '">X</a>';

		$('<div class="attr_box" id="attr_num[' + attributes + ']">' + str + '</div>').appendTo('#attributes');
		// find a element with class kill_attributes
		$('a.kill_attribute').click( function() {
		alert('me');
		});
	});

});
</script>

<div id="attributes">
  <p>
   <a id="add_attribute" href="#"><b class="link_option">Add an attribute</b></a>&nbsp;|&nbsp;
   <a id="add_seperator" href="#"><b class="link_option">Add a seperator</b></a>&nbsp;|&nbsp;
   <a id="clear_attributes" href="#"><b class="link_option">Clear Attributes</b></a>&nbsp;<br />
   <small>ex: address, price, age limit, </small>
  </p>
 <noscript><!-- usually dynamic javascript content --></noscript>
</div>