문제

How do I add an html class attribute to a block returned from

Mage::getBlockSingleton('directory/data')->getCountryHtmlSelect($this->getEstimateCountryId())

in magento?

Is the only option to override the getCountryHtmlSelect() function?

도움이 되었습니까?

해결책

Using jQuery,

$('#selectElementId').addClass('MyClass'); 
$('.selectElementClass').addClass('MyClass'); 

Using Plain Javascript,

document.getElementById("MyElementId").className += " MyClass";

Using PrototypeJS,

element.addClassName(className);

Or the other way, this link may help.

다른 팁

I ended up copying Mage\Directory\Block\Data.php from app\code\core\ to app\code\local and modified the getCountryHtmlSelect() function setClass() order

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