Copy codeThe Code is as follows:
<Script src = "jquery-1.9.1.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
$ (Function (){
Var ping = '';
Switch ($ ('# Select3 option: selected'). text ()){
Case 'image': ping + = 'Case 'text': ping + = '<input type = text'; break;
Case 'button ': ping + =' <input type = click'; break;
}
$ ('# Attrzhi'). blur (function (){
Ping + = '';
Ping + = $ ('# Select2 option: selected'). text ();
Ping + = ';
Ping + = $ ('# attrzhi'). val ();
})
$ ('# Button1'). click (function (){
Ping + = '/> ';
Alert (ping );
$ ('# Show'). append (ping );
})
})
</Script>
</Head>
<Body>
<Form id = "form1" runat = "server">
<Div>
<Table>
<Tr> <td> <! -- What --> Add type: </td> <select id = "Select3">
<Option> image </option>
<Option> text box </option>
<Option> button </option>
</Select> </td> <td rowspan = "5" id = 'show'> </td> </tr>
<Tr> <td>
<! -- Attribute value to be set -->
Attribute: </td> <select id = "Select2">
<Option> src </option>
<Option> width </option>
<Option> height </option>
<Option> title </option>
<Option> value </option>
<Option> font-size </option>
<Option> color </option>
</Select>
</Td> </tr>
<Tr> <td> attribute value: </td> <input id = "attrzhi" type = "text"/> </td> </tr>
<Tr> <td colspan = "2"> <div id = "showattr"> </div> </td> </tr>
<Tr> <td> content: </td> <input id = "Text1" type = "text"/> </td> </tr>
<Tr> <td>
<Input id = "Button1" type = "button" value = "CREATE"/> </td> </tr>
</Table>
</Div>
</Form>
</Body>