Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding SVG's  RSS feed

Priya Sri
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i need to do is I should have one textbox named length and whatever i enter the value in that length,that length should be passed to a <line> attribute as parameter..... and the line should change with that value length....

I wrote line.svg as below....

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "">

<svg width="500" height="400">
<line x1="10" y1="10" x2="490" y2="390" style="stroke:#FF0000; stroke-width:5;"/>

and I called this line.svg in my mysvg.html page as below...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<body><object data="line.svg" width="500"
height="500" type="image/svg+xml">
<embed src="line.svg" width="500"
height="500" type="image/svg+xml" />

how to pass that length value (textbox) to the <line> tag x1,x2 attributes
so that the line changes accordingly...

Guide me...
priya sri
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!