0

I created a filterable DropDown list Using JavaScript. I designed this control using input field, button (Down Arrow) and Select Box with fixed size. If i click down arrow button i'll place the select box under the Input Field. But i want to create the whole controls as a single control. I want to create a own tag for this dropdown list. To show this dropdown list i need to simple call my own tag like

<dropcombo id="xxx" >
   <op>1</op>
   <op>2</op>
</dropcombo>

Here Dropcombo tag is a user defined control. Is there a way to create a own tag for this dropdown combo ?

Smith Dwayne
  • 2,675
  • 8
  • 46
  • 75

2 Answers2

2

The problem with custom HTML tags is that you'll need to use CSS to tell the browser how to render them (as the browser is unaware of how they should look).

<html>
<body>
    <customTag>This is my custom tag</customTag>
</body>

will render as:

This is my custom tag

See https://stackoverflow.com/questions/211394/when-to-use-custom-html-tags for further approaches to solving this problem.

Also, jQuery UI has an .autocomplete() ui extender which I recommend you check out.

Community
  • 1
  • 1
pete
  • 24,141
  • 4
  • 37
  • 51
1

create your tag

dropcombo
{
display:block;
text-align:left;
/* ADD CSS PROPERTY ACCORDING TO YOUR REQUIRDMENT */
}
op
{
/* SAME HERE CSS PROPERTY */
}
Man Programmer
  • 5,300
  • 2
  • 21
  • 21