Categories:

Introduction to Dynamic Properties (aka dynamic expressions)

Last updated: Jan 1st, 2007

One interesting DHTML feature in IE5+ that never quite made it into the spotlight is Dynamic Properties. By their very nature, properties defined in HTML are static, non changing (ie: <div style='width: 300px'>"). Dynamic Properties allows you to substitute static values in HTML with a dynamic expression instead, so instead of "300", it could be "half the width of the browser window." It's a nifty feature that serves to drastically reduce the amount of effort required to change certain HTML property values dynamically. Can't hurt to see what that's all about!

Dynamic Properties can be defined in two ways:

  • Directly within the HTML as a property value of the element in question.
  • Inside your script, by dynamically attaching it to the element.