Suggested fix for Issue #6193

Loop through data- attributes instead of hard coded values.