regex - Get a non inline css from javascript -
i know critic want, ask question.
i know can't style of element if css weren't formated inline. want regex (because not make one) style
tags , apply regex innerhtml
make array 1 :
css["mydiv"]["color"] -> "red"
without using getcomputedstyle
because of browser incompatibility.
there no way achieve remotely close using regex. css rules applied using complicated algorithm , rules may inherited, prioritized , overridden in various ways. no coincidence took major browsers years come compliant implementation.
you should exercise implementation instead. tool need javascript , api need dom. each node in dom there style object contains applied styles , has format close trying generate. can access via getcomputedstyle
, currentstyle
.
Comments
Post a Comment