html - Using one tag css styles for other tag? -


is possible use 1 tag's styles other tag tag? mean have 2 tags: button , input. both have different css styles. need use input tag, use styles 'button' styles, input tag same button. , need 1 input tag, don't want change current styles.

the reason need this, because need use onclick element, , on button tag not seem work (at least in openerp framework), works on input, tag. both tags different, when add input next button tags, not good.

for example (it done in xml):

<button/> <button/> <input type="button" class="button"/> <!-- written button in class element, show use button styles , overwrite styles --> 

you can use 2 classes:

one button

<button class="btn">...</button> 

and other 1 input

<input class="input" /> 

when want change style between 2 elements, change classes:

$('button').removeclass('btn'); $('button').addclass('input'); $('input').removeclass('input'); $('input').addclass('btn'); 

and ok.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -