Python Forum

Full Version: Change item value from 5 to good
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings,
I have spent ages searching javascript in Google, but couldn't find any pointers or examples.

I have a range of values returned in a Table ranging from 1 to 50.
Output:
<table> <td>{{response.responsetime}}</td> </table>
If the value is less than 15, want to return it as good (green - cs), rather than 15.

Could anyone kindly point me to the Javascript method/class??? Spent hours searching, but have not returned any useful results..

Regards,

Clive
The javascript is:

[html]
<div class="grid-child green">
Service Quality
<table class="table" width="25%" class="pos_fixed2">
<thead>
<tbody>
{% for response in service_response %}
<tr>
<td>{{response.service_id}}</td>
<td>{{response.webservicename}}</td>
<td>{{response.responsetime}}</td>
</tr>
{% endfor %}
</tbody>
</thead>
</table>
</div>
[/html]

I tried the javascript below, but get no response. Any suggestions??

Thanks
Clive
<style>
(document.getElementById('pos_fixed2').responsetime:contains(5)').css('color', 'green');
</style>
I'm confused. In both posts, you're showing a template which is executed on the server and are talking about JavaScript, which is executed on the client. On which end do you actually want to make the change?