The value of a New-UDCheckbox is null (via Get-UDElement)

Hi,

i’m trying to get the value of a New-UDCheckbox via Get-UDElement but it is allways null.

New-UDCheckbox -Id Checkbox -Label Checkbox

New-UDElement -Tag div -Endpoint {
        $Checkbox = (Get-UDElement -Id Checkbox).Attributes.value 
        New-UDHeading -Text "Checkbox Value:>$Checkbox<"
} -AutoRefresh -RefreshInterval 5 

Other elements like New-UDTextbox or UDSelect return something.
Am i doing it wrong?

Yes, i’m doing it wrong :man_facepalming:
Found it on the example page: https://github.com/ironmansoftware/universal-dashboard/blob/master/src/poshud/pages/checkbox.ps1

New-UDCheckbox -Id Checkbox -Label InputCheckB

New-UDElement -ID Output -Tag div -Endpoint {
        $Element = Get-UDElement -Id Checkbox
        $tmp = $Element.Attributes["checked"]
        New-UDHeading -Text "Checkbox Value:>$tmp<"
} -AutoRefresh -RefreshInterval 5 
1 Like