mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[js] title setter
This commit is contained in:
parent
4270cb3125
commit
040ab5a189
@ -1632,6 +1632,14 @@ element_set_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
xmlpp::Element *el = JS_GetPrivate(hobj);
|
||||
if (!el) {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string value = JS_EncodeString(ctx, args[0].toString());
|
||||
el->set_attribute("title", value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -9,10 +9,17 @@
|
||||
<script>
|
||||
function aa()
|
||||
{
|
||||
// alert(document.getElementById('blabla').title);
|
||||
alert(document.getElementById('ble').title);
|
||||
}
|
||||
|
||||
function bb()
|
||||
{
|
||||
document.getElementById('ble').title = 'BLEBLE';
|
||||
aa();
|
||||
}
|
||||
|
||||
</script>
|
||||
<button onclick="return aa()">Click me!</button>
|
||||
<button onclick="return bb()">Change title of element</button>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user