문제

I'm implementing microdata on site built in C#. The desired wrapper div for a product should look like this:

<div itemscope itemtype="http://data-vocabulary.org/Product">

It's easy to add the itemtype attribute like below

domElement.Attributes["itemtype"] = "http://data-vocabulary.org/Product";

But I have no idea how can I add a single word attribute like itemscope.

도움이 되었습니까?

해결책

Generally speaking, attributes tend to require values with many libraries. Most people will get around this by writing something like itemscope=true or itemscope="". EDIT: Reworded when I found that some XML implementations do use blank attributes without any issues.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top