alex-romanov,
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
</style>
<script src="https://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$.fn.plugin = function (prop) {
/*атибуты стиля тега 'th'*/
var styleAttributesForTh = {
'border': 'solid 1px green',
'padding': '5px',
'width': 'auto',
'font-size': '20px',
'font-style': 'italic'
};
/* arrTh - массив заголовков*/
var options = $.extend({
selectorForCreateElemInto: 'body'
}, prop);
options.styleForTh = $.extend({}, styleAttributesForTh, options.styleForTh);
return this.each(function (index, self) {
$(self).css(options.styleForTh)
})
}
</script>
<script type="text/javascript">
$(window).load(function(){
$(".box").plugin({
styleForTh : {
border : 'solid 5px red'
}
});
$(".too").plugin();
});
</script>
<title></title>
</head>
<body>
<button class="box">is box</button>
<div class="too">is too</div>
</body>
</html>