Javascript into widget

I’m trying to insert simple javascript using Custom UI into new widget , but when I use the widget in a page, only html is interpreted and javascript is ignored in the published page.
I report the code used below:

table { border-collapse: collapse; } td, th { padding:6px; } table th { background-color:#888888; } table tr { background-color:#D8D8D8; } table tr:nth-child(even) { background-color:#ACACAC; }

Cerca:



Nome elemento Tipologia Prezzo
Esempio 1 Elemento 1 €6,50
Esempio 2 Elemento 2 €5,00
Esempio 3 Elemento 3 €3,00
Esempio 4 Elemento 4 €3,50
Esempio 5 Elemento 5 €3,50