Have used python selenium script to trigger selenium server to run JavaScript code. It works fine.
drv.execute_script(\'\')
execute_script accepts arguments, so you can pass the element:
execute_script
drv.execute_script('arguments[0].setAttribute("style", "color: yellow; border: 2px solid yellow;")', ele)